X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=pcucontrol%2Fmodels%2Fracadm.py;h=f4e69dcc56c26084a699924838a88f2c601be9d9;hp=8dec87538c21a552f18e9fdff5f3001bfbad4272;hb=bbdd1222ad57a915bbb3d872a1cf1da759ef85e3;hpb=3f501b69f366b8b6c62d35d6aea4ebf5fa0f1192 diff --git a/pcucontrol/models/racadm.py b/pcucontrol/models/racadm.py index 8dec875..f4e69dc 100755 --- a/pcucontrol/models/racadm.py +++ b/pcucontrol/models/racadm.py @@ -100,7 +100,9 @@ def racadm_reboot(host, username, password, dryrun, state="powercycle"): from optparse import OptionParser parser = OptionParser() -parser.set_defaults(ip="", user="", password="", state="powercycle") +parser.set_defaults(ip="", user="", password="", dryrun=False, state="powercycle") +parser.add_option("-d", "", dest="dryrun", action="store_true", + help="enable dryrun tests. no action is taken") parser.add_option("-r", "", dest="ip", metavar="nodename.edu", help="A single node name to add to the nodegroup") parser.add_option("-u", "", dest="user", metavar="username", @@ -117,6 +119,6 @@ if __name__ == '__main__': options.user is not "" and \ options.password is not "": - racadm_reboot(options.ip, options.user, options.password, False, options.state) + racadm_reboot(options.ip, options.user, options.password, options.dryrun, options.state) else: parser.print_help()