Renamed and licensed python-glazierclient
This commit is contained in:
parent
ca4ad79179
commit
f354f73aac
9
python-glazierclient/README.rst
Normal file
9
python-glazierclient/README.rst
Normal file
@ -0,0 +1,9 @@
|
||||
Python bindings to the Glazier API
|
||||
=====================
|
||||
This is a client library for Glazier built on the Glazier API. It
|
||||
provides a Python API (the ``glazierclient`` module) and a command-line tool
|
||||
(``glazier``).
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
* `Glazier <http://glazier.mirantis.com>`__
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
import os
|
||||
|
||||
project = 'python-portasclient'
|
||||
project = 'python-glazierclient'
|
||||
|
||||
# -- General configuration ----------------------------------------------------
|
||||
|
@ -1,9 +1,9 @@
|
||||
Python API
|
||||
==========
|
||||
Glazier API Client
|
||||
==================
|
||||
In order to use the python api directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so::
|
||||
|
||||
>>> from portasclient import Client
|
||||
>>> portas = Client('1', endpoint=PORTAS_URL, token=OS_AUTH_TOKEN)
|
||||
>>> from glazierclient import Client
|
||||
>>> glazier = Client('1', endpoint=GLAZIER_URL, token=OS_AUTH_TOKEN)
|
||||
...
|
||||
|
||||
|
||||
@ -18,10 +18,10 @@ In order to use the CLI, you must provide your OpenStack username, password, ten
|
||||
|
||||
The command line tool will attempt to reauthenticate using your provided credentials for every request. You can override this behavior by manually supplying an auth token using ``--os-image-url`` and ``--os-auth-token``. You can alternatively set these environment variables::
|
||||
|
||||
export PORTAS_URL=http://portas.example.org:8082/
|
||||
export GLAZIER_URL=http://glazier.example.org:8082/
|
||||
export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
|
||||
|
||||
Once you've configured your authentication parameters, you can run ``portas help`` to see a complete listing of available commands.
|
||||
Once you've configured your authentication parameters, you can run ``glazier help`` to see a complete listing of available commands.
|
||||
|
||||
|
||||
Release Notes
|
13
python-glazierclient/glazierclient/__init__.py
Normal file
13
python-glazierclient/glazierclient/__init__.py
Normal file
@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
@ -1,3 +1,5 @@
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
@ -9,8 +11,7 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from portasclient.common import utils
|
||||
from glazierclient.common import utils
|
||||
|
||||
|
||||
def Client(version, *args, **kwargs):
|
@ -21,7 +21,7 @@ import StringIO
|
||||
import urlparse
|
||||
|
||||
import os
|
||||
from portasclient.common import exceptions
|
||||
from glazierclient.common import exceptions
|
||||
|
||||
|
||||
try:
|
||||
@ -41,7 +41,7 @@ if not hasattr(urlparse, 'parse_qsl'):
|
||||
urlparse.parse_qsl = cgi.parse_qsl
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
USER_AGENT = 'python-portasclient'
|
||||
USER_AGENT = 'python-glazierclient'
|
||||
CHUNKSIZE = 1024 * 64 # 64kB
|
||||
|
||||
|
@ -17,9 +17,9 @@ import sys
|
||||
import uuid
|
||||
|
||||
import os
|
||||
from portasclient.common import exceptions
|
||||
from glazierclient.common import exceptions
|
||||
import prettytable
|
||||
from portasclient.openstack.common import importutils
|
||||
from glazierclient.openstack.common import importutils
|
||||
|
||||
|
||||
# Decorator for cli-args
|
||||
@ -107,7 +107,7 @@ def env(*vars, **kwargs):
|
||||
|
||||
|
||||
def import_versioned_module(version, submodule=None):
|
||||
module = 'portasclient.v%s' % version
|
||||
module = 'glazierclient.v%s' % version
|
||||
if submodule:
|
||||
module = '.'.join((module, submodule))
|
||||
return importutils.import_module(module)
|
@ -52,7 +52,7 @@ class VersionInfo(object):
|
||||
# The most likely cause for this is running tests in a tree
|
||||
# produced from a tarball where the package itself has not been
|
||||
# installed into anything. Revert to setup-time logic.
|
||||
from portasclient.openstack.common import setup
|
||||
from glazierclient.openstack.common import setup
|
||||
return setup.get_version(self.package)
|
||||
|
||||
def release_string(self):
|
@ -1,3 +1,5 @@
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
@ -11,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
Command-line interface to the Windows Datacenter as a Service.
|
||||
Command-line interface to the Glazier Project.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@ -20,19 +22,19 @@ import sys
|
||||
|
||||
import httplib2
|
||||
from keystoneclient.v2_0 import client as ksclient
|
||||
from portasclient import client as portasclient
|
||||
from portasclient.common import utils, exceptions
|
||||
from glazierclient import client as glazierclient
|
||||
from glazierclient.common import utils, exceptions
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PortasShell(object):
|
||||
class GlazierShell(object):
|
||||
def get_base_parser(self):
|
||||
parser = argparse.ArgumentParser(
|
||||
prog='portas',
|
||||
prog='glazier',
|
||||
description=__doc__.strip(),
|
||||
epilog='See portas help COMMAND" '
|
||||
epilog='See glazier help COMMAND" '
|
||||
'for help on a specific command.',
|
||||
add_help=False,
|
||||
formatter_class=HelpFormatter,
|
||||
@ -44,9 +46,9 @@ class PortasShell(object):
|
||||
help=argparse.SUPPRESS,)
|
||||
|
||||
parser.add_argument('-d', '--debug',
|
||||
default=bool(utils.env('PORTASCLIENT_DEBUG')),
|
||||
default=bool(utils.env('GLAZIERCLIENT_DEBUG')),
|
||||
action='store_true',
|
||||
help='Defaults to env[PORTASCLIENT_DEBUG]')
|
||||
help='Defaults to env[GLAZIERCLIENT_DEBUG]')
|
||||
|
||||
parser.add_argument('-v', '--verbose',
|
||||
default=False, action="store_true",
|
||||
@ -55,7 +57,7 @@ class PortasShell(object):
|
||||
parser.add_argument('-k', '--insecure',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help="Explicitly allow portasclient to perform "
|
||||
help="Explicitly allow glazierclient to perform "
|
||||
"\"insecure\" SSL (https) requests. "
|
||||
"The server's certificate will "
|
||||
"not be verified against any certificate "
|
||||
@ -110,14 +112,14 @@ class PortasShell(object):
|
||||
default=utils.env('OS_AUTH_TOKEN'),
|
||||
help='Defaults to env[OS_AUTH_TOKEN]')
|
||||
|
||||
parser.add_argument('--portas-url',
|
||||
default=utils.env('PORTAS_URL'),
|
||||
help='Defaults to env[PORTAS_URL]')
|
||||
parser.add_argument('--glazier-url',
|
||||
default=utils.env('GLAZIER_URL'),
|
||||
help='Defaults to env[GLAZIER_URL]')
|
||||
|
||||
parser.add_argument('--portas-api-version',
|
||||
parser.add_argument('--glazier-api-version',
|
||||
default=utils.env(
|
||||
'PORTAS_API_VERSION', default='1'),
|
||||
help='Defaults to env[PORTAS_API_VERSION] '
|
||||
'GLAZIER_API_VERSION', default='1'),
|
||||
help='Defaults to env[GLAZIER_API_VERSION] '
|
||||
'or 1')
|
||||
|
||||
parser.add_argument('--os-service-type',
|
||||
@ -202,7 +204,7 @@ class PortasShell(object):
|
||||
self._setup_debugging(options.debug)
|
||||
|
||||
# build available subcommands based on version
|
||||
api_version = options.portas_api_version
|
||||
api_version = options.glazier_api_version
|
||||
subcommand_parser = self.get_subcommand_parser(api_version)
|
||||
self.parser = subcommand_parser
|
||||
|
||||
@ -220,9 +222,9 @@ class PortasShell(object):
|
||||
self.do_help(args)
|
||||
return 0
|
||||
|
||||
if args.os_auth_token and args.portas_url:
|
||||
if args.os_auth_token and args.glazier_url:
|
||||
token = args.os_auth_token
|
||||
endpoint = args.portas_url
|
||||
endpoint = args.glazier_url
|
||||
else:
|
||||
if not args.os_username:
|
||||
raise exceptions.CommandError("You must provide a username "
|
||||
@ -256,7 +258,7 @@ class PortasShell(object):
|
||||
_ksclient = self._get_ksclient(**kwargs)
|
||||
token = args.os_auth_token or _ksclient.auth_token
|
||||
|
||||
url = args.portas_url
|
||||
url = args.glazier_url
|
||||
endpoint = url or self._get_endpoint(_ksclient, **kwargs)
|
||||
|
||||
kwargs = {
|
||||
@ -268,7 +270,7 @@ class PortasShell(object):
|
||||
'key_file': args.key_file,
|
||||
}
|
||||
|
||||
client = portasclient.Client(api_version, endpoint, **kwargs)
|
||||
client = glazierclient.Client(api_version, endpoint, **kwargs)
|
||||
|
||||
try:
|
||||
args.func(client, args)
|
||||
@ -301,7 +303,7 @@ class HelpFormatter(argparse.HelpFormatter):
|
||||
|
||||
def main():
|
||||
try:
|
||||
PortasShell().main(sys.argv[1:])
|
||||
GlazierShell().main(sys.argv[1:])
|
||||
|
||||
except Exception, e:
|
||||
print >> sys.stderr, e
|
@ -1,5 +1,4 @@
|
||||
# Copyright 2012 OpenStack LLC.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,4 +12,4 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from portasclient.v1.client import Client
|
||||
from glazierclient.v1.client import Client
|
@ -1,5 +1,4 @@
|
||||
# Copyright 2012 OpenStack LLC.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,22 +12,21 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from portasclient.common import http
|
||||
from portasclient.v1 import environments, sessions, services
|
||||
from glazierclient.common import http
|
||||
from glazierclient.v1 import environments, sessions, services
|
||||
|
||||
|
||||
class Client(http.HTTPClient):
|
||||
"""Client for the Portas v1 API.
|
||||
"""Client for the Glazier v1 API.
|
||||
|
||||
:param string endpoint: A user-supplied endpoint URL for the ceilometer
|
||||
service.
|
||||
:param string endpoint: A user-supplied endpoint URL for the service.
|
||||
:param string token: Token for authentication.
|
||||
:param integer timeout: Allows customization of the timeout for client
|
||||
http requests. (optional)
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
""" Initialize a new client for the Portas v1 API. """
|
||||
""" Initialize a new client for the Glazier v1 API. """
|
||||
super(Client, self).__init__(*args, **kwargs)
|
||||
self.environments = environments.EnvironmentManager(self)
|
||||
self.sessions = sessions.SessionManager(self)
|
@ -1,5 +1,4 @@
|
||||
# Copyright 2012 OpenMeter LLC.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from portasclient.common import base
|
||||
from glazierclient.common import base
|
||||
|
||||
|
||||
class Environment(base.Resource):
|
@ -1,5 +1,4 @@
|
||||
# Copyright 2012 OpenMeter LLC.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -12,9 +11,8 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from mercurial import patch
|
||||
|
||||
from portasclient.common import base
|
||||
from glazierclient.common import base
|
||||
|
||||
|
||||
class ActiveDirectory(base.Resource):
|
@ -1,5 +1,4 @@
|
||||
# Copyright 2012 OpenMeter LLC.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -12,9 +11,8 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import anyjson
|
||||
|
||||
from portasclient.common import base
|
||||
from glazierclient.common import base
|
||||
|
||||
|
||||
class Session(base.Resource):
|
@ -1,5 +1,4 @@
|
||||
# Copyright 2012 OpenStack LLC.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -13,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from portasclient.common import utils
|
||||
from glazierclient.common import utils
|
||||
|
||||
|
||||
def do_environment_list(cc, args={}):
|
@ -1,6 +1,4 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright 2012 OpenStack Foundation
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
@ -15,6 +13,6 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
from portasclient.openstack.common import version as common_version
|
||||
from glazierclient.openstack.common import version as common_version
|
||||
|
||||
version_info = common_version.VersionInfo('python-portasclient')
|
||||
version_info = common_version.VersionInfo('python-glazierclient')
|
@ -4,4 +4,4 @@
|
||||
modules=setup,importutils,version
|
||||
|
||||
# The base module to hold the copy of openstack.common
|
||||
base=portasclient
|
||||
base=glazierclient
|
@ -2,7 +2,7 @@
|
||||
|
||||
function usage {
|
||||
echo "Usage: $0 [OPTION]..."
|
||||
echo "Run python-portasclient's test suite(s)"
|
||||
echo "Run python-glazierclient's test suite(s)"
|
||||
echo ""
|
||||
echo " -p, --pep8 Just run pep8"
|
||||
echo " -h, --help Print this usage message"
|
@ -1,5 +1,5 @@
|
||||
[nosetests]
|
||||
cover-package = portasclient
|
||||
cover-package = glazierclient
|
||||
cover-html = true
|
||||
cover-erase = true
|
||||
cover-inclusive = true
|
50
python-glazierclient/setup.py
Normal file
50
python-glazierclient/setup.py
Normal file
@ -0,0 +1,50 @@
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import setuptools
|
||||
|
||||
from glazierclient.openstack.common import setup
|
||||
|
||||
project = 'python-glazierclient'
|
||||
|
||||
|
||||
setuptools.setup(
|
||||
name=project,
|
||||
version=setup.get_version(project, '2013.1'),
|
||||
author='Mirantis, Inc.',
|
||||
author_email='smelikyan@mirantis.com',
|
||||
description="Client library for Glazier Project",
|
||||
license='Apache',
|
||||
url='http://glazier.mirantis.com/',
|
||||
packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
|
||||
include_package_data=True,
|
||||
install_requires=setup.parse_requirements(),
|
||||
test_suite="nose.collector",
|
||||
cmdclass=setup.get_cmdclass(),
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Environment :: Console',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: Information Technology',
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
],
|
||||
entry_points={
|
||||
'console_scripts': ['glazier = glazierclient.shell:main']
|
||||
},
|
||||
dependency_links=setup.parse_dependency_links(),
|
||||
tests_require=setup.parse_requirements(['tools/test-requires']),
|
||||
setup_requires=['setuptools-git>=0.4'],
|
||||
)
|
13
python-glazierclient/tests/__init__.py
Normal file
13
python-glazierclient/tests/__init__.py
Normal file
@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
13
python-glazierclient/tests/glazierclient/__init__.py
Normal file
13
python-glazierclient/tests/glazierclient/__init__.py
Normal file
@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
@ -1,22 +1,21 @@
|
||||
# Copyright (c) 2013 Mirantis Inc.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import unittest
|
||||
import logging
|
||||
from httpretty import HTTPretty, httprettified
|
||||
from portasclient.client import Client
|
||||
from glazierclient.client import Client
|
||||
|
||||
|
||||
LOG = logging.getLogger('Unit tests')
|
@ -1,26 +1,25 @@
|
||||
# Copyright (c) 2013 Mirantis Inc.
|
||||
# Copyright (c) 2013 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import unittest
|
||||
import logging
|
||||
from mock import MagicMock
|
||||
|
||||
from portasclient.client import Client
|
||||
import portasclient.v1.environments as environments
|
||||
import portasclient.v1.services as services
|
||||
import portasclient.v1.sessions as sessions
|
||||
from glazierclient.client import Client
|
||||
import glazierclient.v1.environments as environments
|
||||
import glazierclient.v1.services as services
|
||||
import glazierclient.v1.sessions as sessions
|
||||
|
||||
def my_mock(*a, **b):
|
||||
return [a, b]
|
||||
@ -33,7 +32,7 @@ class UnitTestsForClassesAndFunctions(unittest.TestCase):
|
||||
|
||||
def test_create_client_instance(self):
|
||||
|
||||
endpoint = 'http://no-resolved-host:8001'
|
||||
endpoint = 'http://no-resolved-host:8001'
|
||||
test_client = Client('1', endpoint=endpoint, token='1', timeout=10)
|
||||
|
||||
assert test_client.environments is not None
|
@ -20,7 +20,7 @@
|
||||
# under the License.
|
||||
|
||||
"""
|
||||
Installation script for python-portasclient's development virtualenv
|
||||
Installation script for python-glazierclient's development virtualenv
|
||||
"""
|
||||
|
||||
import os
|
||||
@ -32,12 +32,12 @@ import install_venv_common as install_venv
|
||||
|
||||
def print_help():
|
||||
help = """
|
||||
Portas development environment setup is complete.
|
||||
Glazier development environment setup is complete.
|
||||
|
||||
Portas development uses virtualenv to track and manage Python dependencies
|
||||
Glazier development uses virtualenv to track and manage Python dependencies
|
||||
while in development and testing.
|
||||
|
||||
To activate the Portas virtualenv for the extent of your current shell session
|
||||
To activate the Glazier virtualenv for the extent of your current shell session
|
||||
you can run:
|
||||
|
||||
$ source .venv/bin/activate
|
||||
@ -58,7 +58,7 @@ def main(argv):
|
||||
pip_requires = os.path.join(root, 'tools', 'pip-requires')
|
||||
test_requires = os.path.join(root, 'tools', 'test-requires')
|
||||
py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1])
|
||||
project = 'python-portasclient'
|
||||
project = 'python-glazierclient'
|
||||
install = install_venv.InstallVenv(root, venv, pip_requires, test_requires,
|
||||
py_version, project)
|
||||
options = install.parse_args(argv)
|
@ -14,13 +14,13 @@ commands = nosetests
|
||||
|
||||
[testenv:pep8]
|
||||
deps = pep8==1.3.3
|
||||
commands = pep8 --repeat --show-source portasclient setup.py
|
||||
commands = pep8 --repeat --show-source glazierclient setup.py
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:cover]
|
||||
commands = nosetests --cover-erase --cover-package=portasclient --with-xcoverage
|
||||
commands = nosetests --cover-erase --cover-package=glazierclient --with-xcoverage
|
||||
|
||||
[tox:jenkins]
|
||||
downloadcache = ~/cache/pip
|
||||
@ -38,7 +38,7 @@ deps = file://{toxinidir}/.cache.bundle
|
||||
[testenv:jenkinscover]
|
||||
deps = file://{toxinidir}/.cache.bundle
|
||||
setenv = NOSE_WITH_XUNIT=1
|
||||
commands = nosetests --cover-erase --cover-package=portasclient --with-xcoverage
|
||||
commands = nosetests --cover-erase --cover-package=glazierclient --with-xcoverage
|
||||
|
||||
[testenv:jenkinsvenv]
|
||||
deps = file://{toxinidir}/.cache.bundle
|
@ -1,6 +0,0 @@
|
||||
Python bindings to the Portas API
|
||||
=====================================
|
||||
|
||||
This is a client library for Portas built on the Portas API. It
|
||||
provides a Python API (the ``portasclient`` module) and a command-line tool
|
||||
(``portas``).
|
@ -1,7 +0,0 @@
|
||||
Keero Portas Client README
|
||||
=====================
|
||||
Portas Client provides CLI and Pythin bindings to Portas API.
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
* `Keero <http://keero.mirantis.com>`__
|
@ -1,48 +0,0 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import setuptools
|
||||
|
||||
from portasclient.openstack.common import setup
|
||||
|
||||
project = 'python-portasclient'
|
||||
|
||||
|
||||
setuptools.setup(
|
||||
name=project,
|
||||
version=setup.get_version(project, '2013.1'),
|
||||
author='OpenStack',
|
||||
author_email='openstack@lists.launchpad.net',
|
||||
description="Client library for portas",
|
||||
license='Apache',
|
||||
url='http://portas.openstack.org/',
|
||||
packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
|
||||
include_package_data=True,
|
||||
install_requires=setup.parse_requirements(),
|
||||
test_suite="nose.collector",
|
||||
cmdclass=setup.get_cmdclass(),
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Environment :: Console',
|
||||
'Intended Audience :: Developers',
|
||||
'Intended Audience :: Information Technology',
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
],
|
||||
entry_points={
|
||||
'console_scripts': ['portas = portasclient.shell:main']
|
||||
},
|
||||
dependency_links=setup.parse_dependency_links(),
|
||||
tests_require=setup.parse_requirements(['tools/test-requires']),
|
||||
setup_requires=['setuptools-git>=0.4'],
|
||||
)
|
@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2013 Mirantis Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>portasclient</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.python.pydev.PyDevBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.python.pydev.pythonNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?eclipse-pydev version="1.0"?><pydev_project>
|
||||
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
|
||||
<path>/portasclient</path>
|
||||
</pydev_pathproperty>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
|
||||
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
|
||||
</pydev_project>
|
@ -1,14 +0,0 @@
|
||||
# Copyright (c) 2013 Mirantis Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
Loading…
x
Reference in New Issue
Block a user