diff --git a/.eggs/README.txt b/.eggs/README.txt new file mode 100644 index 0000000..5d01668 --- /dev/null +++ b/.eggs/README.txt @@ -0,0 +1,6 @@ +This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. + +This directory caches those eggs to prevent repeated downloads. + +However, it is safe to delete this directory. + diff --git a/iotronicclient/exc.py b/iotronicclient/exc.py index 0fbf601..d2ffe03 100644 --- a/iotronicclient/exc.py +++ b/iotronicclient/exc.py @@ -28,6 +28,7 @@ class AmbiguousAuthSystem(ClientException): """Could not obtain token and endpoint using provided credentials.""" pass + # Alias for backwards compatibility AmbigiousAuthSystem = AmbiguousAuthSystem diff --git a/iotronicclient/shell.py b/iotronicclient/shell.py index 088731f..0029657 100644 --- a/iotronicclient/shell.py +++ b/iotronicclient/shell.py @@ -443,5 +443,6 @@ def main(): print(encodeutils.safe_encode(six.text_type(e)), file=sys.stderr) return 1 + if __name__ == "__main__": sys.exit(main()) diff --git a/iotronicclient/v1/exposed_service.py b/iotronicclient/v1/exposed_service.py index 7f41540..547c58d 100644 --- a/iotronicclient/v1/exposed_service.py +++ b/iotronicclient/v1/exposed_service.py @@ -104,3 +104,9 @@ class ExposedServiceManager(base.Manager): path = "%(board)s/services/restore" % { 'board': board_ident} return self._list(self._path(path), "exposed") + + def status_services(self, board_ident): + + path = "%(board)s/services/status" % { + 'board': board_ident} + return self._list(self._path(path), "exposed") diff --git a/iotronicclient/v1/exposed_service_shell.py b/iotronicclient/v1/exposed_service_shell.py index d665d0c..3fcc78b 100644 --- a/iotronicclient/v1/exposed_service_shell.py +++ b/iotronicclient/v1/exposed_service_shell.py @@ -119,7 +119,6 @@ def do_restore_service(cc, args): help="Name or UUID of the board.") def do_restore_services(cc, args): """Execute an action of the service.""" - fields = res_fields.EXPOSED_SERVICE_RESOURCE_ON_BOARD.fields field_labels = res_fields.EXPOSED_SERVICE_RESOURCE_ON_BOARD.labels list = cc.exposed_service.restore_services(args.board) @@ -130,3 +129,12 @@ def do_restore_services(cc, args): json_flag=args.json) else: print(_('%s') % 'no services could be found') + + +@cliutils.arg('board', + metavar='', + help="Name or UUID of the board.") +def do_status_services(cc, args): + """Get status of sevices of the board.""" + result = cc.exposed_service.status_services(args.board) + print(_('%s') % result) diff --git a/iotronicclient/v1/webservice.py b/iotronicclient/v1/webservice.py index 1ff54f0..0a3c70e 100644 --- a/iotronicclient/v1/webservice.py +++ b/iotronicclient/v1/webservice.py @@ -187,6 +187,11 @@ class WebServiceOnBoardManager(base.CreateManager): return self.api.raw_request('DELETE', self._path(path)) + def renew_webservice(self, board_ident): + path = "%s/webservices/renew" % board_ident + + return self.api.raw_request('GET', self._path(path)) + class EnabledWebservice(base.Resource): def __repr__(self): diff --git a/iotronicclient/v1/webservice_shell.py b/iotronicclient/v1/webservice_shell.py index 64aba1c..55a0684 100644 --- a/iotronicclient/v1/webservice_shell.py +++ b/iotronicclient/v1/webservice_shell.py @@ -312,6 +312,14 @@ def do_disable_webservices(cc, args): cc.webserviceonboard.disable_webservice(args.board) +@cliutils.arg( + 'board', + metavar='', + help="UUID of the board ") +def do_renew_webservice(cc, args): + cc.webserviceonboard.renew_webservice(args.board) + + @cliutils.arg( '--limit', metavar='', diff --git a/requirements.txt b/requirements.txt index 220e3dd..14b8bb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,14 +4,18 @@ pbr>=2.0.0 # Apache-2.0 appdirs>=1.3.0 # MIT License dogpile.cache>=0.6.2 # BSD -jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT +#jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT +jsonschema>=3.2.0 # MIT keystoneauth1>=2.18.0 # Apache-2.0 osc-lib>=1.2.0 # Apache-2.0 -oslo.i18n>=2.1.0 # Apache-2.0 +#oslo.i18n>=2.1.0 # Apache-2.0 +oslo.i18n>=3.15.3 # Apache-2.0 oslo.serialization>=1.10.0 # Apache-2.0 -oslo.utils>=3.20.0 # Apache-2.0 -PrettyTable<0.8,>=0.7.1 # BSD +#oslo.utils>=3.20.0 # Apache-2.0 +oslo.utils>=3.33.0,!=3.39.1,!=3.40.0,!=3.40.1 # Apache-2.0 +#PrettyTable<0.8,>=0.7.1 # BSD +PrettyTable>=2.4.0 python-openstackclient>=3.3.0 # Apache-2.0 PyYAML>=3.10.0 # MIT -requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0 +requests!=2.24.0,!=2.20.0,>=2.10.0 # Apache-2.0 six>=1.9.0 # MIT diff --git a/setup.cfg b/setup.cfg index 32448e8..505a295 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,11 +13,10 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 [files] packages = diff --git a/test-requirements.txt b/test-requirements.txt index 0b28321..b5eb5f0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,8 @@ coverage>=4.0 # Apache-2.0 python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.5.1 # BSD oslosphinx>=4.7.0 # Apache-2.0 -oslotest>=1.10.0 # Apache-2.0 +# oslotest>=1.10.0 # Apache-2.0 +oslotest>=3.2.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index 82da489..29368f7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.3.1 -envlist = py27,pep8 +envlist = py36,py37,py38,pep8 skipsdist = True [testenv] @@ -19,12 +19,20 @@ commands = find . -type f -name "*.pyc" -delete [testenv:pep8] -basepython = python2.7 +basepython = python3.8 +#commands = /usr/local/bin/flake8 {posargs} +#commands = /usr/bin/flake8 {posargs} commands = flake8 {posargs} -[testenv:py27] -basepython = python2.7 +[testenv:py36] +basepython = python3.6 + +[testenv:py37] +basepython = python3.7 + +[testenv:py38] +basepython = python3.8 [flake8] # TODO(dmllr): Analyze or fix the warnings blacklisted below @@ -35,5 +43,5 @@ basepython = python2.7 # E123, E125 skipped as they are invalid PEP-8. show-source = True builtins = _ -ignore = E711,E712,H404,H405,E123,E125,E901,H301 +ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,E711,E712,H405,W504,E731,H238,E126,E128,E731,H405,N530,W504,E129,E741,W503,F821,F999,F841,E402,W605,F405 exclude = .venv,.git,.tox,dist,doc,etc,*lib/python*,*egg,build diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml new file mode 100644 index 0000000..36c88a3 --- /dev/null +++ b/zuul.d/projects.yaml @@ -0,0 +1,7 @@ +- project: + templates: + - openstack-python38-jobs-no-constraints + - openstack-python37-jobs-no-constraints + - openstack-python36-jobs-no-constraints + - check-requirements + - publish-to-pypi