summaryrefslogtreecommitdiff
path: root/lib/leap_cli/config/node.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-07-21 00:55:12 -0700
committerelijah <elijah@riseup.net>2016-08-23 13:37:34 -0700
commit205b61dfe721e6d88fc06b050a0497eeb35f4e02 (patch)
tree518b5799f56d9e224d7ca2d85b3d29ef0c01b3c6 /lib/leap_cli/config/node.rb
parent6fab56fb40256fb2e541ee3ad61490f03254d38e (diff)
added 'leap vm' command
Diffstat (limited to 'lib/leap_cli/config/node.rb')
-rw-r--r--lib/leap_cli/config/node.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/leap_cli/config/node.rb b/lib/leap_cli/config/node.rb
index 2d76b814..23abdee3 100644
--- a/lib/leap_cli/config/node.rb
+++ b/lib/leap_cli/config/node.rb
@@ -9,11 +9,8 @@ module LeapCli; module Config
class Node < Object
attr_accessor :file_paths
- def initialize(environment=nil) #, name=nil)
+ def initialize(environment=nil)
super(environment)
- #if name
- # self['name'] = name
- #end
@node = self
@file_paths = []
end
@@ -38,6 +35,14 @@ module LeapCli; module Config
return vagrant_range.include?(ip_addr)
end
+ def vm?
+ self['vm']
+ end
+
+ def vm_id?
+ self['vm.id'] && !self['vm.id'].empty?
+ end
+
#
# Return a hash table representation of ourselves, with the key equal to the @node.name,
# and the value equal to the fields specified in *keys.