diff options
author | Akihiro Motoki <amotoki@gmail.com> | 2017-04-02 00:49:40 +0900 |
---|---|---|
committer | Akihiro Motoki <amotoki@gmail.com> | 2017-04-02 00:52:12 +0900 |
commit | a905f755b995f358116a11f77de71893b0601937 (patch) | |
tree | c17faeaf27f13a2654dea1ec559ead587ea48af6 /neutronclient/neutron | |
parent | 6b429b327868901dc5bc468e2fe6a32593414e6f (diff) | |
download | python-neutronclient-a905f755b995f358116a11f77de71893b0601937.tar.gz |
Do not append .json to sending URL
Both SessionClient and HTTPClient set content-type as application/json,
so there is no need to append ".json" as a format specifier.
This commit also cleans up 'format' attribute in various client class
and unit tests.
Also hide --request-format opiton from the command line help as it is
just ignored. We need to keep the option to keep backward-compatibility.
Closes-Bug: #1678488
Change-Id: I5fc69b9dfed9b7b6350a4aad06417a914a80d090
Diffstat (limited to 'neutronclient/neutron')
-rw-r--r-- | neutronclient/neutron/v2_0/__init__.py | 2 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/lb/v2/loadbalancer.py | 1 | ||||
-rw-r--r-- | neutronclient/neutron/v2_0/rbac.py | 1 |
3 files changed, 1 insertions, 3 deletions
diff --git a/neutronclient/neutron/v2_0/__init__.py b/neutronclient/neutron/v2_0/__init__.py index a980fe1..b1b675a 100644 --- a/neutronclient/neutron/v2_0/__init__.py +++ b/neutronclient/neutron/v2_0/__init__.py @@ -336,7 +336,7 @@ class NeutronCommand(command.Command): parser = super(NeutronCommand, self).get_parser(prog_name) parser.add_argument( '--request-format', - help=_('DEPRECATED! Only JSON request format is supported.'), + help=argparse.SUPPRESS, default='json', choices=['json', ], ) parser.add_argument( diff --git a/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py b/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py index 8cc6dff..c40809f 100644 --- a/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py +++ b/neutronclient/neutron/v2_0/lb/v2/loadbalancer.py @@ -124,7 +124,6 @@ class RetrieveLoadBalancerStats(neutronV20.ShowCommand): def take_action(self, parsed_args): neutron_client = self.get_client() - neutron_client.format = parsed_args.request_format loadbalancer_id = neutronV20.find_resourceid_by_name_or_id( self.get_client(), 'loadbalancer', parsed_args.id) params = {} diff --git a/neutronclient/neutron/v2_0/rbac.py b/neutronclient/neutron/v2_0/rbac.py index e1153b0..8b356d3 100644 --- a/neutronclient/neutron/v2_0/rbac.py +++ b/neutronclient/neutron/v2_0/rbac.py @@ -82,7 +82,6 @@ class CreateRBACPolicy(neutronV20.CreateCommand): def args2body(self, parsed_args): neutron_client = self.get_client() - neutron_client.format = parsed_args.request_format _object_id, _object_type = get_rbac_obj_params(neutron_client, parsed_args.type, parsed_args.name) |