Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e55840dd82 | ||
|
|
0b630c1de8 | ||
|
|
3edac93182 | ||
|
|
74f828c876 | ||
|
|
641dacabc3 | ||
|
|
776ab9fabe | ||
|
|
df7c98a7ae | ||
|
|
e4980fbb1e | ||
|
|
6821a3352c | ||
|
|
b16aa98e8a | ||
|
|
1110520952 | ||
|
|
b5e952d573 | ||
|
|
68d0a7ece4 | ||
|
|
3c92869735 | ||
|
|
26f966f91f | ||
|
|
5b122a89bc | ||
|
|
8a4995a4fc | ||
|
|
68c676c46f | ||
|
|
16fee61954 | ||
|
|
c67b1b490f | ||
|
|
ee725acb94 | ||
|
|
1a64452662 | ||
|
|
6b6332bd99 | ||
|
|
c68869270e | ||
|
|
0eb328ed07 | ||
|
|
e2e1e67db2 | ||
|
|
a625f7a702 | ||
|
|
71b9c54d0a | ||
|
|
72a42ed2e7 |
@@ -1,5 +1,4 @@
|
||||
[gerrit]
|
||||
host=review.opendev.org
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack/python-karborclient.git
|
||||
defaultbranch=stable/ocata
|
||||
|
||||
12
.zuul.yaml
12
.zuul.yaml
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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", " ")
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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('')
|
||||
|
||||
@@ -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,10 @@ 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."""
|
||||
if not uuidutils.is_uuid_like(args.provider_id):
|
||||
raise exceptions.CommandError(
|
||||
"Invalid provider id provided.")
|
||||
plan_resources = _extract_resources(args)
|
||||
_check_resources(cs, plan_resources)
|
||||
plan_parameters = _extract_parameters(args)
|
||||
@@ -165,7 +169,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 +193,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 +214,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 +277,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 +441,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 +544,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 +653,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 +686,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 +801,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 +918,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 +972,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 +1015,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 +1094,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 +1134,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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
2
setup.py
2
setup.py
@@ -25,5 +25,5 @@ except ImportError:
|
||||
pass
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr>=1.8'],
|
||||
setup_requires=['pbr>=2.0.0'],
|
||||
pbr=True)
|
||||
|
||||
@@ -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
30
tools/tox_install.sh
Executable 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 $?
|
||||
9
tox.ini
9
tox.ini
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user