Commits

Pēteris Caune committed afb5c2b

--node option for "silver run" command

  • Participants
  • Parent commits d22f43b

Comments (0)

Files changed (2)

silverlining/commands/run.py

             translated_args.append(arg)
     zip.close()
     zip_content = out.getvalue()
-    host = normalize_location(args.location)[0]
     if args.user not in ['root', 'www-mgr', 'www-data']:
         raise CommandError(
             "Unknown --user=%s" % args.user)
     if any_translated:
         stdout, stderr, returncode = ssh(
-            args.user, host, '/usr/local/share/silverlining/mgr-scripts/save-tmp-file.py',
+            args.user, config.node_hostname, '/usr/local/share/silverlining/mgr-scripts/save-tmp-file.py',
             stdin=zip_content, capture_stdout=True, capture_stderr=True)
         match = _tmp_re.search(stdout)
         if not match:
     else:
         tmp_location = 'NONE'
     stdout, stderr, returncode = ssh(
-        args.user, host,
+        args.user, config.node_hostname,
         ['/usr/local/share/silverlining/mgr-scripts/run-command.py',
          args.location, tmp_location, args.script] + translated_args)
     return returncode

silverlining/runner.py

 """)
 
 parser_run.add_argument(
+    '--node',
+    metavar="NODE_HOSTNAME",
+    help="Node to run command on")
+
+parser_run.add_argument(
     '-p', '--provider',
     metavar='NAME',
     help="The [provider:NAME] section from ~/.silverlining.conf to use (default [provider:default])",