if len(configProfileName) == 0:
        configProfileName = "config"

    # We need at least these vars
    if len(hostname) == 0:
        print help
        sys.exit()


# Parse arguments
if __name__ == "__main__":
    handleArguments(sys.argv[1:])

# Init our classes
c = cloudstackops.CloudStackOps(DEBUG, DRYRUN)
ssh = cloudstackopsssh.CloudStackOpsSSH(DEBUG, DRYRUN)
c.ssh = ssh
x = xenserver.xenserver()
c.xenserver = x

if DEBUG == 1:
    print "Warning: Debug mode is enabled!"

if DRYRUN == 1:
    print "Warning: dry-run mode is enabled, not running any commands!"

# make credentials file known to our class
c.configProfileName = configProfileName

# Init the CloudStack API
c.initCloudStackAPI()
示例#2
0
    # Print help if required options not provided
    if len(configProfileName) == 0 or len(zone) == 0:
        print help
        exit(1)


## MAIN ##

# Parse arguments
if __name__ == "__main__":
    handle_arguments(sys.argv[1:])

# Init our classes
c = cloudstackops.CloudStackOps(DEBUG, DRYRUN, FORCE)
cs = cloudstackopsssh.CloudStackOpsSSH()

# make credentials file known to our class
c.configProfileName = configProfileName

# Init the CloudStack API
c.initCloudStackAPI()

if DEBUG == 1:
    print "DEBUG: API address: " + c.apiurl
    print "DEBUG: ApiKey: " + c.apikey
    print "DEBUG: SecretKey: " + c.secretkey

# Check cloudstack IDs
if DEBUG == 1:
    print "DEBUG: Checking CloudStack IDs of provided input.."