def _get_vc(): cf = ConfigParser.ConfigParser() cf.read(utils.CONFIG_FILE_PATH) vc_ip = cf.get(utils.INFO_VC, "opt_vc") vc_user = cf.get(utils.INFO_VC, "vc_user") vc_pwd = cf.get(utils.INFO_VC, "vc_pwd") return operations.get_vcenter(vc_ip, vc_user, vc_pwd)
def _get_vc(): cf = ConfigParser.ConfigParser() cf.read(utils.CONFIG_FILE_PATH) vc_ip = cf.get(utils.INFO_VC, 'opt_vc') vc_user = cf.get(utils.INFO_VC, 'vc_user') vc_pwd = cf.get(utils.INFO_VC, 'vc_pwd') return operations.get_vcenter(vc_ip, vc_user, vc_pwd)
def assign_role(args): vc = operations.get_vcenter(args.vc_ip, args.vc_user, args.vc_pwd) vc.assign_role(args.account, args.role)