diff options
Diffstat (limited to 'moonclient')
-rw-r--r-- | moonclient/moonclient/intraextension.py | 14 | ||||
-rw-r--r-- | moonclient/moonclient/shell.py | 2 | ||||
-rw-r--r-- | moonclient/moonclient/tenants.py | 22 |
3 files changed, 19 insertions, 19 deletions
diff --git a/moonclient/moonclient/intraextension.py b/moonclient/moonclient/intraextension.py index c46927cd..1842baa4 100644 --- a/moonclient/moonclient/intraextension.py +++ b/moonclient/moonclient/intraextension.py @@ -37,9 +37,9 @@ class IntraExtensionCreate(Command): def take_action(self, parsed_args): post_data = { - "name": parsed_args.name, - "policymodel": parsed_args.policy_model, - "description": parsed_args.description + "intra_extension_name": parsed_args.name, + "intra_extension_model": parsed_args.policy_model, + "intra_extension_description": parsed_args.description } ie = self.app.get_url("/v3/OS-MOON/intra_extensions", post_data=post_data, authtoken=True) if "id" not in ie: @@ -59,11 +59,11 @@ class IntraExtensionList(Lister): def take_action(self, parsed_args): ie = self.app.get_url("/v3/OS-MOON/intra_extensions", authtoken=True) - if "intra_extensions" not in ie: - raise Exception("Error in command {}".format(ie)) + # if "intra_extensions" not in ie: + # raise Exception("Error in command {}".format(ie)) return ( - ("id",), - ((_id, ) for _id in ie["intra_extensions"]) + ("id", "name", "model"), + ((_id, ie[_id]["name"], ie[_id]["model"]) for _id in ie.keys()) ) diff --git a/moonclient/moonclient/shell.py b/moonclient/moonclient/shell.py index 5005095e..10b96511 100644 --- a/moonclient/moonclient/shell.py +++ b/moonclient/moonclient/shell.py @@ -100,7 +100,7 @@ class MoonClient(App): method = "DELETE" self.log.debug("\033[32m{} {}\033[m".format(method, url)) conn = httplib.HTTPConnection(self.host, self.port) - self.log.info("Host: {}:{}".format(self.host, self.port)) + self.log.debug("Host: {}:{}".format(self.host, self.port)) headers = { "Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", diff --git a/moonclient/moonclient/tenants.py b/moonclient/moonclient/tenants.py index b51b00ee..cc7c1de0 100644 --- a/moonclient/moonclient/tenants.py +++ b/moonclient/moonclient/tenants.py @@ -71,7 +71,7 @@ class TenantAdd(Command): if parsed_args.admin: post_data["tenant_intra_admin_extension_id"] = parsed_args.admin if parsed_args.desc: - post_data["description"] = parsed_args.desc + post_data["tenant_description"] = parsed_args.desc tenants = self.app.get_url("/v3/OS-MOON/tenants", post_data=post_data, authtoken=True) @@ -154,20 +154,20 @@ class TenantSet(Command): def take_action(self, parsed_args): post_data = dict() - post_data["id"] = parsed_args.tenant_id + post_data["tenant_id"] = parsed_args.tenant_id if parsed_args.name: - post_data["name"] = parsed_args.tenant_name - if parsed_args.authz: - post_data["intra_authz_extension_id"] = parsed_args.authz - if parsed_args.admin: - post_data["intra_admin_extension_id"] = parsed_args.admin - if parsed_args.desc: - post_data["description"] = parsed_args.desc - tenants = self.app.get_url("/v3/OS-MOON/tenants/{}".format(post_data["id"]), + post_data["tenant_name"] = parsed_args.tenant_name + if parsed_args.authz is not None: + post_data["tenant_intra_authz_extension_id"] = parsed_args.authz + if parsed_args.admin is not None: + post_data["tenant_intra_admin_extension_id"] = parsed_args.admin + if parsed_args.desc is not None: + post_data["tenant_description"] = parsed_args.desc + tenants = self.app.get_url("/v3/OS-MOON/tenants/{}".format(post_data["tenant_id"]), post_data=post_data, authtoken=True) return ( - ("id", "name", "description", "intra_authz_extension_id", "intra_admin_extension_id"), + ("id", "name", "description", "authz", "admin"), (( tenant_id, tenants[tenant_id]["name"], |