Compare commits

..

6 Commits

Author SHA1 Message Date
OpenDev Sysadmins
7a8e80f62f OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:41:49 +00:00
Nguyen Hai
c138cec2ca import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

* This patch also fix docs failure.

Change-Id: I7e2b27289927f1b3d687dadf3e68c411269c8e08
Story: #2002586
Task: #24303
2018-08-22 23:17:17 +09:00
chenying
42066dcdf0 Fix the errors about parameter when creating a plan
Change-Id: Ibb6ab69c25cf232b15e2138bfc62f91159039a32
Closes-Bug:#1666186
(cherry picked from commit ee725acb94)
2017-02-22 09:51:48 +08:00
xiangxinyong
6702e0c62b Help info error
Modefied other command help error info.

Change-Id: I82fa9bd7524677dc84bab33f57477771198b65de
(cherry picked from commit a625f7a702)
2017-02-14 18:01:30 +08:00
xiangxinyong
3e9ace28ce 'karbor provider-list' help info error
Modified 'karbor provider-list'`s help error info.

Change-Id: I0db08456599c4db96b9effd47db568c460b7ca81
(cherry picked from commit 71b9c54d0a)
2017-02-14 16:07:05 +08:00
Yuval Brik
7426876280 Update defaultbranch for newton
Change-Id: I1a4033cb6c9a384ac6630ec071e4bbe2cfb4c63b
2017-01-29 16:17:21 +02:00
18 changed files with 119 additions and 133 deletions

View File

@@ -1,4 +1,5 @@
[gerrit]
host=review.openstack.org
host=review.opendev.org
port=29418
project=openstack/python-karborclient.git
defaultbranch=stable/ocata

12
.zuul.yaml Normal file
View File

@@ -0,0 +1,12 @@
- project:
templates:
- openstack-python-jobs
- openstack-python35-jobs
- check-requirements
- publish-openstack-sphinx-docs
- openstackclient-plugin-jobs
check:
jobs:
- openstack-tox-cover:
voting: false

View File

@@ -2,8 +2,8 @@
Team and repository tags
========================
.. image:: https://governance.openstack.org/badges/python-karborclient.svg
:target: https://governance.openstack.org/reference/tags/index.html
.. image:: http://governance.openstack.org/badges/python-karborclient.svg
:target: http://governance.openstack.org/reference/tags/index.html
.. Change things from this point on

View File

@@ -54,7 +54,7 @@ def load_auth_system_opts(parser):
"""
group = parser.add_argument_group("Common auth options")
BaseAuthPlugin.add_common_opts(group)
for name, auth_plugin in _discovered_plugins.items():
for name, auth_plugin in six.iteritems(_discovered_plugins):
group = parser.add_argument_group(
"Auth-system '%s' options" % name,
conflict_handler="resolve")

View File

@@ -297,7 +297,7 @@ class CrudManager(BaseManager):
def _filter_kwargs(self, kwargs):
"""Drop null values and handle ids."""
for key, ref in kwargs.copy().items():
for key, ref in six.iteritems(kwargs.copy()):
if ref is None:
kwargs.pop(key)
else:
@@ -470,7 +470,7 @@ class Resource(object):
return None
def _add_details(self, info):
for (k, v) in info.items():
for (k, v) in six.iteritems(info):
try:
setattr(self, k, v)
self._info[k] = v

View File

@@ -22,6 +22,7 @@ Exception definitions.
import inspect
import sys
import six
from karborclient.i18n import _
@@ -409,7 +410,7 @@ class HttpVersionNotSupported(HttpServerError):
# _code_map contains all the classes that have http_status attribute.
_code_map = dict(
(getattr(obj, 'http_status', None), obj)
for name, obj in vars(sys.modules[__name__]).items()
for name, obj in six.iteritems(vars(sys.modules[__name__]))
if inspect.isclass(obj) and getattr(obj, 'http_status', False)
)

View File

@@ -18,7 +18,7 @@ import hashlib
import os
import socket
import keystoneauth1.adapter as keystone_adapter
import keystoneclient.adapter as keystone_adapter
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
@@ -27,6 +27,8 @@ import six
from six.moves import urllib
from karborclient.common.apiclient import exceptions as exc
from karborclient.i18n import _LE
from karborclient.i18n import _LW
LOG = logging.getLogger(__name__)
USER_AGENT = 'python-karborclient'
@@ -48,7 +50,7 @@ def get_system_ca_file():
if os.path.exists(ca):
LOG.debug("Using ca file %s", ca)
return ca
LOG.warning("System ca file could not be found.")
LOG.warning(_LW("System ca file could not be found."))
class HTTPClient(object):
@@ -246,7 +248,7 @@ class HTTPClient(object):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
kwargs['data'] = kwargs.pop('body')
if 'data' in kwargs:
kwargs['data'] = jsonutils.dumps(kwargs['data'])
@@ -258,7 +260,7 @@ class HTTPClient(object):
try:
body = resp.json()
except ValueError:
LOG.error('Could not decode response body as JSON')
LOG.error(_LE('Could not decode response body as JSON'))
else:
body = None
@@ -269,7 +271,7 @@ class HTTPClient(object):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
kwargs['data'] = kwargs.pop('body')
# Chunking happens automatically if 'body' is a
# file-like object
@@ -299,7 +301,7 @@ class HTTPClient(object):
class SessionClient(keystone_adapter.Adapter):
"""karbor specific keystoneauth Adapter.
"""karbor specific keystoneclient Adapter.
"""
@@ -326,7 +328,7 @@ class SessionClient(keystone_adapter.Adapter):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
kwargs['data'] = kwargs.pop('body')
if 'data' in kwargs:
kwargs['data'] = jsonutils.dumps(kwargs['data'])
@@ -351,7 +353,7 @@ class SessionClient(keystone_adapter.Adapter):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
kwargs['data'] = kwargs.pop('body')
resp = keystone_adapter.Adapter.request(self,
url,

View File

@@ -120,7 +120,7 @@ def print_dict(d, property="Property", dict_format_list=None,
json_format_list=None):
pt = prettytable.PrettyTable([property, 'Value'], caching=False)
pt.align = 'l'
for r in d.items():
for r in six.iteritems(d):
r = list(r)
if isinstance(r[1], six.string_types) and "\r" in r[1]:
r[1] = r[1].replace("\r", " ")

View File

@@ -23,6 +23,16 @@ _translators = oslo_i18n.TranslatorFactory(domain='karborclient')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical
def get_available_languages():
return oslo_i18n.get_available_languages('karborclient')

View File

@@ -17,14 +17,14 @@ Command-line interface to the karbor Project.
from __future__ import print_function
import argparse
import copy
import sys
from keystoneauth1 import discover
from keystoneauth1 import exceptions as ks_exc
from keystoneauth1.identity.generic import password
from keystoneauth1.identity.generic import token
from keystoneauth1 import loading
from keystoneclient.auth.identity.generic import password
from keystoneclient.auth.identity.generic import token
from keystoneclient.auth.identity import v3 as identity
from keystoneclient import discover
from keystoneclient import exceptions as ks_exc
from keystoneclient import session as ksession
from oslo_log import handlers
from oslo_log import log as logging
from oslo_utils import encodeutils
@@ -44,20 +44,13 @@ logger = logging.getLogger(__name__)
class KarborShell(object):
def _append_global_identity_args(self, parser, argv):
loading.register_session_argparse_arguments(parser)
# Peek into argv to see if os-auth-token (or the deprecated
# os_auth_token) or the new os-token or the environment variable
# OS_AUTH_TOKEN were given. In which case, the token auth plugin is
# what the user wants. Else, we'll default to password.
default_auth_plugin = 'password'
token_opts = ['os-token', 'os-auth-token', 'os_auth-token']
if argv and any(i in token_opts for i in argv):
default_auth_plugin = 'token'
loading.register_auth_argparse_arguments(
parser, argv, default=default_auth_plugin)
def _append_global_identity_args(self, parser):
# Register the CLI arguments that have moved to the session object.
ksession.Session.register_cli_options(parser)
def get_base_parser(self, argv):
identity.Password.register_argparse_arguments(parser)
def get_base_parser(self):
parser = argparse.ArgumentParser(
prog='karbor',
@@ -106,11 +99,11 @@ class KarborShell(object):
'API response, '
'defaults to system socket timeout.')
parser.add_argument('--os_tenant_id',
parser.add_argument('--os-tenant-id',
default=utils.env('OS_TENANT_ID'),
help='Defaults to env[OS_TENANT_ID].')
parser.add_argument('--os_tenant_name',
parser.add_argument('--os-tenant-name',
default=utils.env('OS_TENANT_NAME'),
help='Defaults to env[OS_TENANT_NAME].')
@@ -150,12 +143,12 @@ class KarborShell(object):
action='store_true',
help='Send os-username and os-password to karbor.')
self._append_global_identity_args(parser, argv)
self._append_global_identity_args(parser)
return parser
def get_subcommand_parser(self, version, argv=None):
parser = self.get_base_parser(argv)
def get_subcommand_parser(self, version):
parser = self.get_base_parser()
self.subcommands = {}
subparsers = parser.add_subparsers(metavar='<subcommand>')
@@ -204,7 +197,7 @@ class KarborShell(object):
v2_auth_url = None
v3_auth_url = None
try:
ks_discover = discover.Discover(session=session, url=auth_url)
ks_discover = discover.Discover(session=session, auth_url=auth_url)
v2_auth_url = ks_discover.url_for('2.0')
v3_auth_url = ks_discover.url_for('3.0')
except ks_exc.ClientException as e:
@@ -296,17 +289,16 @@ class KarborShell(object):
def main(self, argv):
# Parse args once to find version
base_argv = copy.deepcopy(argv)
parser = self.get_base_parser(argv)
(options, args) = parser.parse_known_args(base_argv)
parser = self.get_base_parser()
(options, args) = parser.parse_known_args(argv)
self._setup_logging(options.debug)
# build available subcommands based on version
api_version = options.karbor_api_version
subcommand_parser = self.get_subcommand_parser(api_version, argv)
subcommand_parser = self.get_subcommand_parser(api_version)
self.parser = subcommand_parser
ks_session = None
keystone_session = None
keystone_auth = None
# Handle top-level --help/-h before attempting to parse
@@ -374,12 +366,12 @@ class KarborShell(object):
kwargs['region_name'] = args.os_region_name
else:
# Create a keystone session and keystone auth
ks_session = loading.load_session_from_argparse_arguments(args)
keystone_session = ksession.Session.load_from_cli_options(args)
project_id = args.os_project_id or args.os_tenant_id
project_name = args.os_project_name or args.os_tenant_name
keystone_auth = self._get_keystone_auth(
ks_session,
keystone_session,
args.os_auth_url,
username=args.os_username,
user_id=args.os_user_id,
@@ -396,12 +388,12 @@ class KarborShell(object):
service_type = args.os_service_type or 'data-protect'
endpoint = keystone_auth.get_endpoint(
ks_session,
keystone_session,
service_type=service_type,
region_name=args.os_region_name)
kwargs = {
'session': ks_session,
'session': keystone_session,
'auth': keystone_auth,
'service_type': service_type,
'endpoint_type': endpoint_type,

View File

@@ -15,8 +15,8 @@ import re
import sys
import fixtures
from keystoneauth1 import fixture
from keystoneauth1.fixture import v2 as ks_v2_fixture
from keystoneclient import fixture
from keystoneclient.fixture import v2 as ks_v2_fixture
import mock
from oslo_log import handlers
from oslo_log import log
@@ -134,7 +134,7 @@ class ShellCommandTest(ShellTest):
def test_help(self):
required = [
'.*?^usage: karbor',
'.*?^\s+plan-create\s+Creates a plan.',
'.*?^\s+plan-create\s+Create a plan.',
'.*?^See "karbor help COMMAND" for help on a specific command',
]
stdout, stderr = self.shell('help')
@@ -145,7 +145,7 @@ class ShellCommandTest(ShellTest):
def test_help_on_subcommand(self):
required = [
'.*?^usage: karbor plan-create',
'.*?^Creates a plan.',
'.*?^Create a plan.',
]
stdout, stderr = self.shell('help plan-create')
for r in required:
@@ -155,7 +155,7 @@ class ShellCommandTest(ShellTest):
def test_help_no_options(self):
required = [
'.*?^usage: karbor',
'.*?^\s+plan-create\s+Creates a plan',
'.*?^\s+plan-create\s+Create a plan',
'.*?^See "karbor help COMMAND" for help on a specific command',
]
stdout, stderr = self.shell('')

View File

@@ -118,10 +118,9 @@ def do_plan_list(cs, args):
metavar='<provider_id>',
help='ID of provider.')
@utils.arg('resources',
metavar='<id=type=name=extra_info,id=type=name=extra_info>',
metavar='<id=type=name,id=type=name>',
help='Resource in list must be a dict when creating'
' a plan. The keys of resource are id ,type, name and '
'extra_info. The extra_info field is optional.')
' a plan.The keys of resource are id and type.')
@utils.arg('--parameters-json',
type=str,
dest='parameters_json',
@@ -141,10 +140,7 @@ def do_plan_list(cs, args):
metavar='<description>',
help='The description of a plan.')
def do_plan_create(cs, args):
"""Creates a plan."""
if not uuidutils.is_uuid_like(args.provider_id):
raise exceptions.CommandError(
"Invalid provider id provided.")
"""Create a plan."""
plan_resources = _extract_resources(args)
_check_resources(cs, plan_resources)
plan_parameters = _extract_parameters(args)
@@ -169,7 +165,7 @@ def do_plan_show(cs, args):
nargs="+",
help='ID of plan.')
def do_plan_delete(cs, args):
"""Deletes plan."""
"""Delete plan."""
failure_count = 0
for plan_id in args.plan:
try:
@@ -193,7 +189,7 @@ def do_plan_delete(cs, args):
@utils.arg("--status", metavar="<suspended|started>",
help="status to which the plan will be updated.")
def do_plan_update(cs, args):
"""Updatas a plan."""
"""Updata a plan."""
data = {}
if args.name is not None:
data['name'] = args.name
@@ -214,18 +210,18 @@ def do_plan_update(cs, args):
def _extract_resources(args):
resources = []
for data in args.resources.split(','):
if '=' in data and len(data.split('=')) in [3, 4]:
resource = dict(zip(['id', 'type', 'name', 'extra_info'],
data.split('=')))
if resource.get('extra_info'):
resource['extra_info'] = jsonutils.loads(
resource.get('extra_info'))
resource = {}
if '=' in data:
(resource_id, resource_type, resource_name) = data.split('=', 2)
else:
raise exceptions.CommandError(
"Unable to parse parameter resources. "
"The keys of resource are id , type, name and "
"extra_info. The extra_info field is optional.")
"Unable to parse parameter resources.")
resource["id"] = resource_id
resource["type"] = resource_type
resource["name"] = resource_name
resources.append(resource)
return resources
@@ -277,7 +273,7 @@ def _check_resources(cs, resources):
'Other keys and values: according to provider\'s restore schema.'
)
def do_restore_create(cs, args):
"""Creates a restore."""
"""Create a restore."""
if not uuidutils.is_uuid_like(args.provider_id):
raise exceptions.CommandError(
"Invalid provider id provided.")
@@ -441,7 +437,7 @@ def do_restore_show(cs, args):
def do_protectable_list(cs, args):
"""Lists all protectable types."""
"""Lists all protectables type."""
protectables = cs.protectables.list()
@@ -544,7 +540,7 @@ def do_protectable_list_instances(cs, args):
sort_key=args.sort_key,
sort_dir=args.sort_dir, sort=args.sort)
key_list = ['Id', 'Type', 'Name', 'Dependent resources', 'Extra info']
key_list = ['Id', 'Type', 'Dependent resources']
if args.sort_key or args.sort_dir or args.sort:
sortby_index = None
@@ -653,7 +649,7 @@ def do_provider_list(cs, args):
default=None,
help='The extra info of a checkpoint.')
def do_checkpoint_create(cs, args):
"""Creates a checkpoint."""
"""Create a checkpoint."""
checkpoint_extra_info = None
if args.extra_info is not None:
@@ -686,21 +682,21 @@ def _extract_extra_info(args):
@utils.arg('--plan_id',
metavar='<plan_id>',
default=None,
help='Filters results by a plan ID. Default=None.')
help='Filters results by a plan_id. Default=None.')
@utils.arg('--start_date',
type=str,
metavar='<start_date>',
default=None,
help='Filters results by a start date("Y-m-d"). Default=None.')
help='Filters results by a start_date("Y-m-d"). Default=None.')
@utils.arg('--end_date',
type=str,
metavar='<end_date>',
default=None,
help='Filters results by a end date("Y-m-d"). Default=None.')
help='Filters results by a end_date("Y-m-d"). Default=None.')
@utils.arg('--project_id',
metavar='<project_id>',
default=None,
help='Filters results by a project ID. Default=None.')
help='Filters results by a project id. Default=None.')
@utils.arg('--marker',
metavar='<marker>',
default=None,
@@ -801,7 +797,7 @@ def do_checkpoint_show(cs, args):
nargs="+",
help='ID of checkpoint.')
def do_checkpoint_delete(cs, args):
"""Deletes checkpoints."""
"""Delete checkpoints."""
failure_count = 0
for checkpoint_id in args.checkpoint:
try:
@@ -918,7 +914,7 @@ def do_trigger_list(cs, args):
metavar='<key=value,key=value>',
help='Properties of trigger.')
def do_trigger_create(cs, args):
"""Creates a trigger."""
"""Create a trigger."""
trigger_properties = _extract_properties(args)
trigger = cs.triggers.create(args.name, args.type, trigger_properties)
dict_format_list = {"properties"}
@@ -972,7 +968,7 @@ def do_trigger_show(cs, args):
nargs="+",
help='ID of trigger.')
def do_trigger_delete(cs, args):
"""Deletes trigger."""
"""Delete trigger."""
failure_count = 0
for trigger_id in args.trigger:
try:
@@ -1015,7 +1011,7 @@ def do_trigger_delete(cs, args):
@utils.arg('--operation_definition',
metavar='<operation_definition>',
default=None,
help='Filters results by a operation definition. Default=None.')
help='Filters results by the operation_definition. Default=None.')
@utils.arg('--marker',
metavar='<marker>',
default=None,
@@ -1094,7 +1090,7 @@ def do_scheduledoperation_list(cs, args):
metavar='<key=value,key=value>',
help='Operation definition of scheduled operation.')
def do_scheduledoperation_create(cs, args):
"""Creates a scheduled operation."""
"""Create a scheduled operation."""
operation_definition = _extract_operation_definition(args)
scheduledoperation = cs.scheduled_operations.create(args.name,
args.operation_type,
@@ -1134,7 +1130,7 @@ def do_scheduledoperation_show(cs, args):
nargs="+",
help='ID of scheduled operation.')
def do_scheduledoperation_delete(cs, args):
"""Deletes a scheduled operation."""
"""Delete a scheduled operation."""
failure_count = 0
for scheduledoperation_id in args.scheduledoperation:
try:

View File

@@ -1,13 +1,13 @@
# 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.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
pbr>=1.8 # Apache-2.0
PrettyTable<0.8,>=0.7.1 # BSD
keystoneauth1>=2.20.0 # Apache-2.0
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
python-keystoneclient>=3.8.0 # Apache-2.0
requests!=2.12.2,>=2.10.0 # Apache-2.0
simplejson>=2.2.0 # MIT
Babel!=2.4.0,>=2.3.4 # BSD
Babel>=2.3.4 # BSD
six>=1.9.0 # MIT
oslo.utils>=3.20.0 # Apache-2.0
oslo.log>=3.22.0 # Apache-2.0
oslo.utils>=3.18.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0

View File

@@ -5,7 +5,7 @@ description-file =
README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = https://docs.openstack.org/developer/karbor/
home-page = http://docs.openstack.org/developer/karbor/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@@ -16,6 +16,7 @@ classifier =
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
[global]

View File

@@ -25,5 +25,5 @@ except ImportError:
pass
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
setup_requires=['pbr>=1.8'],
pbr=True)

View File

@@ -2,12 +2,12 @@
# 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<0.11,>=0.10.2 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
coverage>=4.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
docutils>=0.11 # OSI-Approved Open Source, Public Domain
sphinx!=1.6.1,>=1.5.1 # BSD
docutils!=0.13.1,>=0.11 # OSI-Approved Open Source, Public Domain
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
oslosphinx>=4.7.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD

View File

@@ -1,30 +0,0 @@
#!/usr/bin/env bash
# Client constraint file contains this client version pin that is in conflict
# with installing the client from source. We should remove the version pin in
# the constraints file before applying it for from-source installation.
CONSTRAINTS_FILE="$1"
shift 1
set -e
# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
# published to logs.openstack.org for easy debugging.
localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
if [[ "$CONSTRAINTS_FILE" != http* ]]; then
CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE"
fi
# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile"
pip install -c"$localfile" openstack-requirements
# This is the main purpose of the script: Allow local installation of
# the current repo. It is listed in constraints file and thus any
# install will be constrained and we need to unconstrain it.
edit-constraints "$localfile" -- "$CLIENT_NAME"
pip install -c"$localfile" -U "$@"
exit $?

View File

@@ -1,17 +1,18 @@
[tox]
minversion = 2.0
envlist = py35,py27,pypy,pep8
envlist = py35,py34,py27,pypy,pep8
skipsdist = True
[testenv]
usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
install_command = pip install {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
BRANCH_NAME=master
CLIENT_NAME=python-karborclient
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/requirements.txt
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
@@ -33,7 +34,7 @@ commands = python setup.py test --coverage --testr-args='{posargs}'
commands = python setup.py build_sphinx
[testenv:debug]
commands = oslo_debug_helper -t karborclient/tests {posargs}
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.