Compare commits

..

27 Commits

Author SHA1 Message Date
Jenkins
0b630c1de8 Merge "Replace six.iteritems() with .items()" 2017-05-17 07:42:35 +00:00
OpenStack Proposal Bot
3edac93182 Updated from global requirements
Change-Id: I3c6b25063aeb9bf9166a1c515fe268fc9cfa408d
2017-05-17 03:57:47 +00:00
Jenkins
641dacabc3 Merge "Switch from keystoneclient to keystoneauth" 2017-05-09 08:15:07 +00:00
Jeremy Liu
776ab9fabe Switch from keystoneclient to keystoneauth
keystoneauth was extracted from keystoneclient, this CR replaces usage
of keystoneclient in favor of keystoneauth.

Change-Id: Ia310aa4d72590290cc50e0617842d1f79af3089e
Implements: blueprint use-keystoneauth-instead-of-keystoneclient
2017-05-09 11:03:52 +03:00
Jenkins
df7c98a7ae Merge "Replace http with https" 2017-05-08 09:19:48 +00:00
chenying
e4980fbb1e Delete py34 in setup.cfg and tox.ini
We support py35 now. We do not need python 3.4 in setup.cfg which
declares the explicit supported versions. So it is no need to keep
the supoort for py34.

Change-Id: I6c0faf2642ec9e487173be0afce1d27064c56d4d
2017-04-28 15:27:17 +08:00
yfzhao
6821a3352c Replace http with https
Use https instead of http to ensure the safety without containing our
account/password information

Change-Id: I22d4738f54762a0461d5019f7bac9d855e1aba08
2017-04-26 10:37:42 +08:00
OpenStack Proposal Bot
b16aa98e8a Updated from global requirements
Change-Id: Ic51eb6459bcf84a10b6887c3783a233b5fcdea0b
2017-04-18 16:55:40 +00:00
chenying
1110520952 Add extra_info field to Plans API
User can get the extra_info of resource instances from
the response of this API using karborclient.
User can add a resource instance with the extra information
to a plan.

blueprint instances-extra-info
Change-Id: I436fc7f1aa7a98c7b1809bbf97a1f36ef5f3516d
2017-04-14 16:34:39 +08:00
chenying
b5e952d573 Add extra_info field to protectables API
User can get the extra_info of resource instances from
the response of this API using karborclient.
User can add a resource instance with the extra information
to a plan.

blueprint instances-extra-info
Depends-On: Id97b8e5b3c29283320f5d4aa81d3947505b35671

Change-Id: I132c66d7cced3a105e5357043fe05cd67f69a35e
2017-04-14 10:41:15 +08:00
M V P Nitesh
68d0a7ece4 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I3bdceff37eb43058b9a4c7a1f55c2875eb61c9a4
2017-04-03 12:07:03 +05:30
gaozx
3c92869735 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I21f94b34e511ca9fd43332219d15d6d57fcf5ecf
2017-03-21 02:59:26 -04:00
OpenStack Proposal Bot
26f966f91f Updated from global requirements
Change-Id: I0b448725caf6560000bec1230f1b73112c4b61b1
2017-03-07 12:26:58 +00:00
liyanhang
5b122a89bc Fix oslo_debug_helper not running
Specify test directory so that tox won't complain
`ImportError: Start directory is not importable

Closes-Bug: #1666560
Change-Id: Idcf207c321641da5f00b9cee1a50c8626a4d424e
2017-03-05 21:22:14 +08:00
ricolin
8a4995a4fc [Fix gate]Update test requirement
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848

Change-Id: I90910b785795cd07889511495400b1155f1a320f
2017-03-02 20:30:27 +08:00
Jenkins
68c676c46f Merge "Unified help information style" 2017-02-27 06:43:22 +00:00
Jenkins
16fee61954 Merge "protectable list help info error" 2017-02-27 06:43:15 +00:00
Jenkins
c67b1b490f Merge "Command karbor help info error" 2017-02-27 06:43:08 +00:00
chenying
ee725acb94 Fix the errors about parameter when creating a plan
Change-Id: Ibb6ab69c25cf232b15e2138bfc62f91159039a32
Closes-Bug:#1666186
2017-02-20 19:43:01 +08:00
xiangxinyong
1a64452662 protectable list help info error
Modified protectable list help infomation.

Change-Id: I0388992c3494ad4581475cf83a5512a68835576d
2017-02-16 05:42:41 +08:00
xiangxinyong
6b6332bd99 Unified help information style
Change-Id: I08e573ab67c20af065722d79eb7b4e0169b5ae23
2017-02-16 04:11:49 +08:00
xiangxinyong
c68869270e Command karbor help info error
Modeified karbor help info error

Change-Id: I35b919848cc94267cd0b34e0541a0c0e44169137
2017-02-16 04:07:53 +08:00
Jenkins
0eb328ed07 Merge "Help info error" 2017-02-14 09:55:39 +00:00
Jenkins
e2e1e67db2 Merge "'karbor provider-list' help info error" 2017-02-14 07:48:40 +00:00
xiangxinyong
a625f7a702 Help info error
Modefied other command help error info.

Change-Id: I82fa9bd7524677dc84bab33f57477771198b65de
2017-02-14 09:38:50 +08:00
xiangxinyong
71b9c54d0a 'karbor provider-list' help info error
Modified 'karbor provider-list'`s help error info.

Change-Id: I0db08456599c4db96b9effd47db568c460b7ca81
2017-02-14 09:19:58 +08:00
OpenStack Proposal Bot
72a42ed2e7 Updated from global requirements
Change-Id: I6017a7396a657fbe8a58a729814ac7043998b4dd
2017-02-11 17:51:26 +00:00
18 changed files with 130 additions and 119 deletions

View File

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

View File

@@ -1,12 +0,0 @@
- 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:: http://governance.openstack.org/badges/python-karborclient.svg
:target: http://governance.openstack.org/reference/tags/index.html
.. image:: https://governance.openstack.org/badges/python-karborclient.svg
:target: https://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 six.iteritems(_discovered_plugins):
for name, auth_plugin in _discovered_plugins.items():
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 six.iteritems(kwargs.copy()):
for key, ref in kwargs.copy().items():
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 six.iteritems(info):
for (k, v) in info.items():
try:
setattr(self, k, v)
self._info[k] = v

View File

@@ -22,7 +22,6 @@ Exception definitions.
import inspect
import sys
import six
from karborclient.i18n import _
@@ -410,7 +409,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 six.iteritems(vars(sys.modules[__name__]))
for name, obj in vars(sys.modules[__name__]).items()
if inspect.isclass(obj) and getattr(obj, 'http_status', False)
)

View File

@@ -18,7 +18,7 @@ import hashlib
import os
import socket
import keystoneclient.adapter as keystone_adapter
import keystoneauth1.adapter as keystone_adapter
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
@@ -27,8 +27,6 @@ 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'
@@ -50,7 +48,7 @@ def get_system_ca_file():
if os.path.exists(ca):
LOG.debug("Using ca file %s", ca)
return ca
LOG.warning(_LW("System ca file could not be found."))
LOG.warning("System ca file could not be found.")
class HTTPClient(object):
@@ -248,7 +246,7 @@ class HTTPClient(object):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
kwargs['data'] = kwargs.pop('body')
if 'data' in kwargs:
kwargs['data'] = jsonutils.dumps(kwargs['data'])
@@ -260,7 +258,7 @@ class HTTPClient(object):
try:
body = resp.json()
except ValueError:
LOG.error(_LE('Could not decode response body as JSON'))
LOG.error('Could not decode response body as JSON')
else:
body = None
@@ -271,7 +269,7 @@ class HTTPClient(object):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
kwargs['data'] = kwargs.pop('body')
# Chunking happens automatically if 'body' is a
# file-like object
@@ -301,7 +299,7 @@ class HTTPClient(object):
class SessionClient(keystone_adapter.Adapter):
"""karbor specific keystoneclient Adapter.
"""karbor specific keystoneauth Adapter.
"""
@@ -328,7 +326,7 @@ class SessionClient(keystone_adapter.Adapter):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
LOG.warning("Use of 'body' is deprecated; use 'data' instead")
kwargs['data'] = kwargs.pop('body')
if 'data' in kwargs:
kwargs['data'] = jsonutils.dumps(kwargs['data'])
@@ -353,7 +351,7 @@ class SessionClient(keystone_adapter.Adapter):
if 'data' in kwargs:
raise ValueError("Can't provide both 'data' and "
"'body' to a request")
LOG.warning(_LW("Use of 'body' is deprecated; use 'data' instead"))
LOG.warning("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 six.iteritems(d):
for r in d.items():
r = list(r)
if isinstance(r[1], six.string_types) and "\r" in r[1]:
r[1] = r[1].replace("\r", " ")

View File

@@ -23,16 +23,6 @@ _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 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 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 oslo_log import handlers
from oslo_log import log as logging
from oslo_utils import encodeutils
@@ -44,13 +44,20 @@ logger = logging.getLogger(__name__)
class KarborShell(object):
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 _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)
identity.Password.register_argparse_arguments(parser)
def get_base_parser(self):
def get_base_parser(self, argv):
parser = argparse.ArgumentParser(
prog='karbor',
@@ -99,11 +106,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].')
@@ -143,12 +150,12 @@ class KarborShell(object):
action='store_true',
help='Send os-username and os-password to karbor.')
self._append_global_identity_args(parser)
self._append_global_identity_args(parser, argv)
return parser
def get_subcommand_parser(self, version):
parser = self.get_base_parser()
def get_subcommand_parser(self, version, argv=None):
parser = self.get_base_parser(argv)
self.subcommands = {}
subparsers = parser.add_subparsers(metavar='<subcommand>')
@@ -197,7 +204,7 @@ class KarborShell(object):
v2_auth_url = None
v3_auth_url = None
try:
ks_discover = discover.Discover(session=session, auth_url=auth_url)
ks_discover = discover.Discover(session=session, 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:
@@ -289,16 +296,17 @@ class KarborShell(object):
def main(self, argv):
# Parse args once to find version
parser = self.get_base_parser()
(options, args) = parser.parse_known_args(argv)
base_argv = copy.deepcopy(argv)
parser = self.get_base_parser(argv)
(options, args) = parser.parse_known_args(base_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)
subcommand_parser = self.get_subcommand_parser(api_version, argv)
self.parser = subcommand_parser
keystone_session = None
ks_session = None
keystone_auth = None
# Handle top-level --help/-h before attempting to parse
@@ -366,12 +374,12 @@ class KarborShell(object):
kwargs['region_name'] = args.os_region_name
else:
# Create a keystone session and keystone auth
keystone_session = ksession.Session.load_from_cli_options(args)
ks_session = loading.load_session_from_argparse_arguments(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(
keystone_session,
ks_session,
args.os_auth_url,
username=args.os_username,
user_id=args.os_user_id,
@@ -388,12 +396,12 @@ class KarborShell(object):
service_type = args.os_service_type or 'data-protect'
endpoint = keystone_auth.get_endpoint(
keystone_session,
ks_session,
service_type=service_type,
region_name=args.os_region_name)
kwargs = {
'session': keystone_session,
'session': ks_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 keystoneclient import fixture
from keystoneclient.fixture import v2 as ks_v2_fixture
from keystoneauth1 import fixture
from keystoneauth1.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+Create a plan.',
'.*?^\s+plan-create\s+Creates 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',
'.*?^Create a plan.',
'.*?^Creates 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+Create a plan',
'.*?^\s+plan-create\s+Creates a plan',
'.*?^See "karbor help COMMAND" for help on a specific command',
]
stdout, stderr = self.shell('')

View File

@@ -118,9 +118,10 @@ def do_plan_list(cs, args):
metavar='<provider_id>',
help='ID of provider.')
@utils.arg('resources',
metavar='<id=type=name,id=type=name>',
metavar='<id=type=name=extra_info,id=type=name=extra_info>',
help='Resource in list must be a dict when creating'
' a plan.The keys of resource are id and type.')
' a plan. The keys of resource are id ,type, name and '
'extra_info. The extra_info field is optional.')
@utils.arg('--parameters-json',
type=str,
dest='parameters_json',
@@ -140,7 +141,7 @@ def do_plan_list(cs, args):
metavar='<description>',
help='The description of a plan.')
def do_plan_create(cs, args):
"""Create a plan."""
"""Creates a plan."""
plan_resources = _extract_resources(args)
_check_resources(cs, plan_resources)
plan_parameters = _extract_parameters(args)
@@ -165,7 +166,7 @@ def do_plan_show(cs, args):
nargs="+",
help='ID of plan.')
def do_plan_delete(cs, args):
"""Delete plan."""
"""Deletes plan."""
failure_count = 0
for plan_id in args.plan:
try:
@@ -189,7 +190,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):
"""Updata a plan."""
"""Updatas a plan."""
data = {}
if args.name is not None:
data['name'] = args.name
@@ -210,18 +211,18 @@ def do_plan_update(cs, args):
def _extract_resources(args):
resources = []
for data in args.resources.split(','):
resource = {}
if '=' in data:
(resource_id, resource_type, resource_name) = data.split('=', 2)
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'))
else:
raise exceptions.CommandError(
"Unable to parse parameter resources.")
resource["id"] = resource_id
resource["type"] = resource_type
resource["name"] = resource_name
"Unable to parse parameter resources. "
"The keys of resource are id , type, name and "
"extra_info. The extra_info field is optional.")
resources.append(resource)
return resources
@@ -273,7 +274,7 @@ def _check_resources(cs, resources):
'Other keys and values: according to provider\'s restore schema.'
)
def do_restore_create(cs, args):
"""Create a restore."""
"""Creates a restore."""
if not uuidutils.is_uuid_like(args.provider_id):
raise exceptions.CommandError(
"Invalid provider id provided.")
@@ -437,7 +438,7 @@ def do_restore_show(cs, args):
def do_protectable_list(cs, args):
"""Lists all protectables type."""
"""Lists all protectable types."""
protectables = cs.protectables.list()
@@ -540,7 +541,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', 'Dependent resources']
key_list = ['Id', 'Type', 'Name', 'Dependent resources', 'Extra info']
if args.sort_key or args.sort_dir or args.sort:
sortby_index = None
@@ -649,7 +650,7 @@ def do_provider_list(cs, args):
default=None,
help='The extra info of a checkpoint.')
def do_checkpoint_create(cs, args):
"""Create a checkpoint."""
"""Creates a checkpoint."""
checkpoint_extra_info = None
if args.extra_info is not None:
@@ -682,21 +683,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,
@@ -797,7 +798,7 @@ def do_checkpoint_show(cs, args):
nargs="+",
help='ID of checkpoint.')
def do_checkpoint_delete(cs, args):
"""Delete checkpoints."""
"""Deletes checkpoints."""
failure_count = 0
for checkpoint_id in args.checkpoint:
try:
@@ -914,7 +915,7 @@ def do_trigger_list(cs, args):
metavar='<key=value,key=value>',
help='Properties of trigger.')
def do_trigger_create(cs, args):
"""Create a trigger."""
"""Creates a trigger."""
trigger_properties = _extract_properties(args)
trigger = cs.triggers.create(args.name, args.type, trigger_properties)
dict_format_list = {"properties"}
@@ -968,7 +969,7 @@ def do_trigger_show(cs, args):
nargs="+",
help='ID of trigger.')
def do_trigger_delete(cs, args):
"""Delete trigger."""
"""Deletes trigger."""
failure_count = 0
for trigger_id in args.trigger:
try:
@@ -1011,7 +1012,7 @@ def do_trigger_delete(cs, args):
@utils.arg('--operation_definition',
metavar='<operation_definition>',
default=None,
help='Filters results by the operation_definition. Default=None.')
help='Filters results by a operation definition. Default=None.')
@utils.arg('--marker',
metavar='<marker>',
default=None,
@@ -1090,7 +1091,7 @@ def do_scheduledoperation_list(cs, args):
metavar='<key=value,key=value>',
help='Operation definition of scheduled operation.')
def do_scheduledoperation_create(cs, args):
"""Create a scheduled operation."""
"""Creates a scheduled operation."""
operation_definition = _extract_operation_definition(args)
scheduledoperation = cs.scheduled_operations.create(args.name,
args.operation_type,
@@ -1130,7 +1131,7 @@ def do_scheduledoperation_show(cs, args):
nargs="+",
help='ID of scheduled operation.')
def do_scheduledoperation_delete(cs, args):
"""Delete a scheduled operation."""
"""Deletes 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>=1.8 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0
PrettyTable<0.8,>=0.7.1 # BSD
python-keystoneclient>=3.8.0 # Apache-2.0
requests!=2.12.2,>=2.10.0 # Apache-2.0
keystoneauth1>=2.20.0 # Apache-2.0
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
simplejson>=2.2.0 # MIT
Babel>=2.3.4 # BSD
Babel!=2.4.0,>=2.3.4 # BSD
six>=1.9.0 # MIT
oslo.utils>=3.18.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
oslo.utils>=3.20.0 # Apache-2.0
oslo.log>=3.22.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 = http://docs.openstack.org/developer/karbor/
home-page = https://docs.openstack.org/developer/karbor/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@@ -16,7 +16,6 @@ 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>=1.8'],
setup_requires=['pbr>=2.0.0'],
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.11,>=0.10.2 # Apache-2.0
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage>=4.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD
docutils!=0.13.1,>=0.11 # OSI-Approved Open Source, Public Domain
sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
docutils>=0.11 # OSI-Approved Open Source, Public Domain
sphinx!=1.6.1,>=1.5.1 # BSD
oslosphinx>=4.7.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD

30
tools/tox_install.sh Executable file
View File

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