# File lib/rudy/huxtable.rb, line 150
150:     def defined_keypairpath(name=nil)
151:       name ||= current_machine_user
152:       raise Rudy::Error, "No user provided" unless name
153:       ## NOTE: I think it is more appropriate to return nil here
154:       ## than raise errors. This stuff should be checked already
155:       ##raise NoConfig unless @@config
156:       ##raise NoMachinesConfig unless @@config.machines
157:       ##raise NoGlobal unless @@global
158:       return unless @@global && @@config && @@config.machines
159:       zon, env, rol = @@global.zone, @@global.environment, @@global.role
160:       path = @@global.identity
161:       path ||= @@config.machines.find_deferred(zon, env, rol, [:users, name, :keypair])
162:       path ||= @@config.machines.find_deferred(env, rol, [:users, name, :keypair])
163:       path ||= @@config.machines.find_deferred(rol, [:users, name, :keypair])
164:       path ||= @@config.machines.find_deferred(@@global.region, [:users, name, :keypair])
165:       path
166:     end