Update hacking version

1. update hacking version to latest
2. fix pep8 failed

Change-Id: I49a6d46466b06bd56bed1f15632c9c80ef539b38
This commit is contained in:
ZhijunWei 2018-12-28 23:04:46 +08:00
parent b4a38cdcc8
commit 463eab47e4
7 changed files with 24 additions and 26 deletions

View File

@ -1,7 +1,7 @@
# 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
# process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0

View File

@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.
__all__ = ['__version__']
import pbr.version
__all__ = ['__version__']
version_info = pbr.version.VersionInfo('python-troveclient')
# We have a circular import problem when we first run python setup.py sdist
# It's harmless, so deflect it.

View File

@ -21,6 +21,7 @@ Trove Command line tool
import os
import sys
from troveclient.compat import common
# If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
@ -31,8 +32,6 @@ if os.path.exists(os.path.join(possible_topdir, 'troveclient',
'__init__.py')):
sys.path.insert(0, possible_topdir)
from troveclient.compat import common
class InstanceCommands(common.AuthedCommandsBase):
"""Commands to perform various instance operations and actions."""
@ -454,8 +453,8 @@ def main():
# Parse arguments
load_file = True
for index, arg in enumerate(sys.argv):
if (arg == "auth" and len(sys.argv) > (index + 1)
and sys.argv[index + 1] == "login"):
if (arg == "auth" and len(sys.argv) > (index + 1) and
sys.argv[index + 1] == "login"):
load_file = False
oparser = common.CliOptions.create_optparser(load_file)

View File

@ -22,6 +22,7 @@ import json
import os
import sys
from troveclient.compat import common
# If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
@ -32,8 +33,6 @@ if os.path.exists(os.path.join(possible_topdir, 'troveclient.compat',
'__init__.py')):
sys.path.insert(0, possible_topdir)
from troveclient.compat import common
oparser = None

View File

@ -62,13 +62,13 @@ class ServiceCatalog(object):
if version == 'v2':
skip_service_type_check = True
if (not skip_service_type_check
and service.get("type") != service_type):
if (not skip_service_type_check and
service.get("type") != service_type):
continue
if (database_service_name and service_type in ('database',
'databasev2')
and service.get('name') != database_service_name):
'databasev2') and
service.get('name') != database_service_name):
continue
endpoints = service['endpoints']

View File

@ -248,8 +248,8 @@ class Backups(base.ManagerWithFind):
def execution_list_generator():
yielded = 0
for sexec in mistral_execution_generator():
if (sexec.workflow_name == cron_trigger.workflow_name
and ct_input == json.loads(sexec.input)):
if (sexec.workflow_name == cron_trigger.workflow_name and
ct_input == json.loads(sexec.input)):
yield ScheduleExecution(self, sexec.to_dict(),
loaded=True)
yielded += 1

View File

@ -22,6 +22,15 @@ import time
from troveclient.i18n import _
try:
import simplejson as json
except ImportError:
import json
from troveclient import exceptions
from troveclient import utils
from troveclient.v1 import modules
INSTANCE_ARG_NAME = _('instance')
INSTANCE_METAVAR = _('"opt=<value>[,opt=<value> ...] "')
INSTANCE_ERROR = _("Instance argument(s) must be of the form --instance "
@ -53,15 +62,6 @@ EXT_PROPS_HELP = _("Add extended properties for cluster create. "
" mongos_volume_size=<disk_size_in_GB>, "
" mongos_volume_type=<volume_type>.")
try:
import simplejson as json
except ImportError:
import json
from troveclient import exceptions
from troveclient import utils
from troveclient.v1 import modules
def _poll_for_status(poll_fn, obj_id, action, final_ok_states,
poll_period=5, show_progress=True):
@ -811,8 +811,8 @@ def _strip_option(opts_str, opt_name, is_required=True,
if is_required and not opt_value:
raise exceptions.MissingArgs([opt_name],
message=(_("Missing option '%s' for "
"argument --instance ")
+ INSTANCE_METAVAR))
"argument --instance ") +
INSTANCE_METAVAR))
return opt_value, opts_str.strip().strip(",")