Merge "Update GBPClient to work with NeutronClient Master (Post Juno)"

This commit is contained in:
Jenkins
2015-04-13 17:37:46 +00:00
committed by Gerrit Code Review
6 changed files with 11 additions and 14 deletions

View File

@@ -15,8 +15,8 @@ import logging
import string import string
from neutronclient.common import utils from neutronclient.common import utils
from neutronclient.i18n import _
from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron import v2_0 as neutronV20
from neutronclient.openstack.common.gettextutils import _
from oslo.serialization import jsonutils from oslo.serialization import jsonutils

View File

@@ -22,8 +22,8 @@ import string
from heatclient.common import template_utils from heatclient.common import template_utils
from neutronclient.common import exceptions as exc from neutronclient.common import exceptions as exc
from neutronclient.i18n import _
from neutronclient.neutron import v2_0 as neutronV20 from neutronclient.neutron import v2_0 as neutronV20
from neutronclient.openstack.common.gettextutils import _
class ListServiceChainInstance(neutronV20.ListCommand): class ListServiceChainInstance(neutronV20.ListCommand):

View File

@@ -27,6 +27,7 @@ from keystoneclient.auth.identity import v3 as v3_auth
from keystoneclient import discover from keystoneclient import discover
from keystoneclient.openstack.common.apiclient import exceptions as ks_exc from keystoneclient.openstack.common.apiclient import exceptions as ks_exc
from keystoneclient import session from keystoneclient import session
from oslo.utils import encodeutils
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
from cliff import app from cliff import app
@@ -34,8 +35,7 @@ from cliff import commandmanager
from neutronclient.common import clientmanager from neutronclient.common import clientmanager
from neutronclient.common import exceptions as exc from neutronclient.common import exceptions as exc
from neutronclient.common import utils from neutronclient.common import utils
from neutronclient.openstack.common.gettextutils import _ from neutronclient.i18n import _
from neutronclient.openstack.common import strutils
from neutronclient.version import __version__ from neutronclient.version import __version__
from gbpclient.gbp.v2_0 import groupbasedpolicy as gbp from gbpclient.gbp.v2_0 import groupbasedpolicy as gbp
@@ -826,7 +826,7 @@ class GBPShell(app.App):
def main(argv=sys.argv[1:]): def main(argv=sys.argv[1:]):
try: try:
return GBPShell(NEUTRON_API_VERSION).run(map(strutils.safe_decode, return GBPShell(NEUTRON_API_VERSION).run(map(encodeutils.safe_decode,
argv)) argv))
except exc.NeutronClientException: except exc.NeutronClientException:
return 1 return 1

View File

@@ -33,7 +33,7 @@ from keystoneclient import session
from neutronclient import client from neutronclient import client
from neutronclient.common import exceptions from neutronclient.common import exceptions
from neutronclient.common import utils from neutronclient.common import utils
from neutronclient.openstack.common import jsonutils from oslo_serialization import jsonutils
USERNAME = 'testuser' USERNAME = 'testuser'
@@ -450,7 +450,7 @@ class CLITestAuthKeystone(testtools.TestCase):
self.assertRaises( self.assertRaises(
ks_exceptions.EndpointNotFound, ks_exceptions.EndpointNotFound,
self.client.authenticate) getattr, self.client, 'endpoint_url')
def test_strip_credentials_from_log(self): def test_strip_credentials_from_log(self):
def verify_no_credentials(kwargs): def verify_no_credentials(kwargs):

View File

@@ -16,11 +16,11 @@ import time
import urllib import urllib
from neutronclient import client from neutronclient import client
from neutronclient.common import _
from neutronclient.common import constants from neutronclient.common import constants
from neutronclient.common import exceptions from neutronclient.common import exceptions
from neutronclient.common import serializer from neutronclient.common import serializer
from neutronclient.common import utils from neutronclient.common import utils
from neutronclient.i18n import _
import requests import requests
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
@@ -703,14 +703,11 @@ class Client(object):
if type(params) is dict and params: if type(params) is dict and params:
params = utils.safe_encode_dict(params) params = utils.safe_encode_dict(params)
action += '?' + urllib.urlencode(params, doseq=1) action += '?' + urllib.urlencode(params, doseq=1)
# Ensure client always has correct uri - do not guesstimate anything
self.httpclient.authenticate_and_fetch_endpoint_url()
self._check_uri_length(action)
if body: if body:
body = self.serialize(body) body = self.serialize(body)
self.httpclient.content_type = self.content_type() resp, replybody = self.httpclient.do_request(
resp, replybody = self.httpclient.do_request(action, method, body=body) action, method, body=body, content_type=self.content_type())
status_code = resp.status_code status_code = resp.status_code
if status_code in (requests.codes.ok, if status_code in (requests.codes.ok,
requests.codes.created, requests.codes.created,

View File

@@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order # The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
-e git://github.com/openstack/python-neutronclient.git@f8e2e42835e6f3bc0ab321d3a7c25e0109ff5e0a#egg=python-neutronclient -e git://github.com/openstack/python-neutronclient.git#egg=python-neutronclient
hacking>=0.8.0,<0.9 hacking>=0.8.0,<0.9
cliff-tablib>=1.0 cliff-tablib>=1.0