How to use the cloudmonkey.cloudmonkey.CloudMonkeyShell function in cloudmonkey

To help you get started, we’ve selected a few cloudmonkey examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cloudstack-cloudmonkey / cloudmonkey / cloudmonkey.py View on Github external
parser.add_argument("-d", "--display-type",
                        dest="displayType", default=None,
                        help="output displays: json, xml, table or default",
                        choices=tuple(display_types))

    parser.add_argument("-p", "--profile",
                        dest="serverProfile", default=None,
                        help="server profile to load")

    parser.add_argument("commands", nargs=argparse.REMAINDER,
                        help="API commands")

    argcomplete.autocomplete(parser)
    args = parser.parse_args()

    shell = CloudMonkeyShell(sys.argv[0], args.configFile)

    if args.displayType and args.displayType in display_types:
        shell.set_attr("display", args.displayType)

    if args.noblock_async:
        shell.set_attr("asyncblock", "false")

    if args.block_async:
        shell.set_attr("asyncblock", "true")

    if args.serverProfile and args.serverProfile.strip() != '':
        shell.do_set("profile %s" % args.serverProfile)

    if len(args.commands) > 0:
        shell.set_attr("color", "false")
        commands = []
github apache / cloudstack-cloudmonkey / cloudmonkey / cloudmonkey.py View on Github external
def cmdloop(self, intro=None):
        self.interpreterMode = True
        print(self.intro)
        print "Using management server profile:", self.profile, "\n"
        while True:
            try:
                super(CloudMonkeyShell, self).cmdloop(intro="")
            except KeyboardInterrupt:
                print("^C")