]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
allow ssh to disabled nodes
authorelijah <elijah@riseup.net>
Tue, 30 Jul 2013 04:06:36 +0000 (21:06 -0700)
committerelijah <elijah@riseup.net>
Tue, 30 Jul 2013 04:06:36 +0000 (21:06 -0700)
lib/leap_cli/commands/node.rb
lib/leap_cli/commands/shell.rb
lib/leap_cli/config/manager.rb

index b700a907d6bb221b9e8a7037ede629a7a3c8b264..0d330719742247168013ef3bb581505398e42d46 100644 (file)
@@ -139,9 +139,12 @@ module LeapCli; module Commands
     write_file!(:known_hosts, buffer.string)
   end
 
-  def get_node_from_args(args)
+  def get_node_from_args(args, options={})
     node_name = args.first
     node = manager.node(node_name)
+    if node.nil? && options[:include_disabled]
+      node = manager.disabled_node(node_name)
+    end
     assert!(node, "Node '#{node_name}' not found.")
     node
   end
index e87e8102517199b8577b64b68315c1844f75b700..40990e997c71c583b5bd6fd58064cc956ef16e96 100644 (file)
@@ -35,7 +35,7 @@ module LeapCli; module Commands
   private
 
   def exec_ssh(cmd, args)
-    node = get_node_from_args(args)
+    node = get_node_from_args(args, :include_disabled => true)
     options = [
       "-o 'HostName=#{node.ip_address}'",
       # "-o 'HostKeyAlias=#{node.name}'", << oddly incompatible with ports in known_hosts file, so we must not use this or non-standard ports break.
index f34566c0473d4700ae804f1d1a42d32e8c2a2809..9f057132f6557e475823ca622e968c8155537c0d 100644 (file)
@@ -184,7 +184,14 @@ module LeapCli
       # returns a single Config::Object that corresponds to a Node.
       #
       def node(name)
-        nodes[name]
+        @nodes[name]
+      end
+
+      #
+      # returns a single node that is disabled
+      #
+      def disabled_node(name)
+        @disabled_nodes[name]
       end
 
       #