diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/leap_cli/macros/core.rb | 9 | ||||
-rw-r--r-- | lib/leap_cli/macros/hosts.rb | 2 | ||||
-rw-r--r-- | lib/leap_cli/macros/nodes.rb | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/leap_cli/macros/core.rb b/lib/leap_cli/macros/core.rb index ebea3a6e..873da358 100644 --- a/lib/leap_cli/macros/core.rb +++ b/lib/leap_cli/macros/core.rb @@ -47,8 +47,13 @@ module LeapCli # applies a JSON partial to this node # def apply_partial(partial_path) - manager.partials(partial_path).each do |partial_data| - self.deep_merge!(partial_data) + if env.partials[partial_path] + self.deep_merge!(env.partials[partial_path]) + else + raise ArgumentError.new( + "No such partial `%s`. Available partials include:\n%s" % + [partial_path, env.partials.keys.join(", ")] + ) end end diff --git a/lib/leap_cli/macros/hosts.rb b/lib/leap_cli/macros/hosts.rb index 541bbc13..963857ae 100644 --- a/lib/leap_cli/macros/hosts.rb +++ b/lib/leap_cli/macros/hosts.rb @@ -17,7 +17,7 @@ module LeapCli node_list = node_list['environment' => '!local'] end node_list.map {|name, n| - [n.ip_address, (global.facts[name]||{})['ec2_public_ipv4']] + [n.ip_address, (manager.facts[name]||{})['ec2_public_ipv4']] }.flatten.compact.uniq end diff --git a/lib/leap_cli/macros/nodes.rb b/lib/leap_cli/macros/nodes.rb index 8b961cbc..0e23831d 100644 --- a/lib/leap_cli/macros/nodes.rb +++ b/lib/leap_cli/macros/nodes.rb @@ -11,14 +11,14 @@ module LeapCli # the list of all the nodes # def nodes - global.nodes + env.nodes end # # simple alias for global.provider # def provider - global.provider + env.provider end # |