Add files required to pbr installation

This commit is contained in:
efedorova 2013-10-15 15:20:11 +04:00
parent fd76c068bc
commit a44cb523b9
15 changed files with 337 additions and 0 deletions

7
.idea/dictionaries/fervent.xml generated Normal file
View File

@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="fervent">
<words>
<w>metadataclient</w>
</words>
</dictionary>
</component>

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
EkaterinaFedorova <efedorova@mirantis.com>

5
ChangeLog Normal file
View File

@ -0,0 +1,5 @@
commit fd76c068bcc3b6e9e3a33599ecc0e594a72c0ad1
Author: EkaterinaFedorova <efedorova@mirantis.com>
Date: Mon Oct 14 07:15:29 2013 -0700
Initial commit

View File

@ -0,0 +1,15 @@
# 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.
from metadataclient.v1.client import Client

View 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.

View File

@ -0,0 +1,35 @@
# Copyright 2012 OpenStack LLC.
# All Rights Reserved.
#
# 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.
from metadataclient.common import http
from metadataclient.v1 import metadata_client
from metadataclient.v1 import metadata_admin
class Client(http.HTTPClient):
"""Client for the Murano Metadata Repository v1 API.
:param string endpoint: A user-supplied endpoint URL for the glance
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 Murano Metadata Client v1 API."""
super(Client, self).__init__(*args, **kwargs)
self.metadata_client = metadata_client.MetadataClientManager(self)
# self.metadata_admin = metadata_admin.MetadataAdminManager(self)

View File

@ -0,0 +1,58 @@
# 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.
from muranoclient.common import base
class MetadataAdmin(base.Resource):
def __repr__(self):
return "<Metadata Client %s>" % self._info
class MetadataAdminManager(base.Manager):
resource_class = MetadataAdmin
def list_ui(self, path=None):
if path:
return self._list('/v1/admin/ui/{path}'.format(path=path))
else:
return self._list('/v1/admin/ui')
def list_agent(self, path=None):
if path:
return self._list('/v1/admin/agent/{path}'.format(path=path))
else:
return self._list('/v1/admin/agent')
def list_heat(self, path=None):
if path:
return self._list('/v1/admin/heat/{path}'.format(path=path))
else:
return self._list('/v1/admin/heat')
def list_workflows(self, path=None):
if path:
return self._list('/v1/admin/workflows/{path}'.format(path=path))
else:
return self._list('/v1/admin/workflows')
def list_scripts(self, path=None):
if path:
return self._list('/v1/admin/scripts/{path}'.format(path=path))
else:
return self._list('/v1/admin/scripts')
def get_file(self):
#application/octet
pass

View File

@ -0,0 +1,30 @@
# 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.
from muranoclient.common import base
class MetadataClient(base.Resource):
def __repr__(self):
return "<Metadata Client %s>" % self._info
class MetadataClientManager(base.Manager):
resource_class = MetadataClient
def get_ui_archive(self):
return self._get('/v1/client/ui')
def conductor(self):
return self._get('/v1/client/conductor')

View File

@ -0,0 +1,23 @@
# 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.
from muranoclient.common import utils
def do_environment_list(cc, args={}):
"""List the environments"""
environments = cc.environments.list()
field_labels = ['ID', 'Name', 'Created', 'Updated']
fields = ['id', 'name', 'created', 'updated']
utils.print_list(environments, fields, field_labels, sortby=0)

10
requirements.txt Normal file
View File

@ -0,0 +1,10 @@
d2to1>=0.2.10,<0.3
pbr>=0.5,<0.6
argparse
prettytable>=0.6,<0.7
python-keystoneclient>=0.1.2
httplib2
iso8601>=0.1.4
six
Babel>=0.9.6
pyOpenSSL

43
setup.cfg Normal file
View File

@ -0,0 +1,43 @@
[metadata]
name = python-metadataclient
version = 0.1
summary = python-metadataclient
description-file =
README.rst
license = Apache License, Version 2.0
author = Mirantis, Inc.
author-email = murano-all@lists.openstack.org
home-page = htts://launchpad.net/murano
classifier =
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
[files]
packages =
metadataclient
[entry_points]
console_scripts =
murano = metadataclient.shell:main
[global]
setup-hooks =
pbr.hooks.setup_hook
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html

24
setup.py Normal file
View File

@ -0,0 +1,24 @@
# 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
import multiprocessing
setuptools.setup(
setup_requires=[
'd2to1>=0.2.10,<0.3',
'pbr>=0.5,<0.6'
],
d2to1=True,
)

15
test-requirements.txt Normal file
View File

@ -0,0 +1,15 @@
distribute>=0.6.24
mock
anyjson
mox
nose
nose-exclude
nosexcover
openstack.nose_plugin
nosehtmloutput
pep8==1.3.3
setuptools-git>=0.4
sphinx>=1.1.2
unittest2
httpretty

58
tox.ini Normal file
View File

@ -0,0 +1,58 @@
[tox]
envlist = py27,pep8,pep8,pyflakes
[testenv]
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = nosetests
[testenv:pep8]
deps = pep8==1.3.3
commands = pep8 --repeat --show-source metadataclient setup.py
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = nosetests --cover-erase --cover-package=metadataclient --with-xcoverage
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv:jenkins26]
basepython = python2.6
setenv = NOSE_WITH_XUNIT=1
deps = file://{toxinidir}/.cache.bundle
[testenv:jenkins27]
basepython = python2.7
setenv = NOSE_WITH_XUNIT=1
deps = file://{toxinidir}/.cache.bundle
[testenv:jenkinscover]
deps = file://{toxinidir}/.cache.bundle
setenv = NOSE_WITH_XUNIT=1
commands = nosetests --cover-erase --cover-package=metadataclient --with-xcoverage
[testenv:jenkinsvenv]
deps = file://{toxinidir}/.cache.bundle
setenv = NOSE_WITH_XUNIT=1
commands = {posargs}
[testenv:pyflakes]
deps = flake8
commands = flake8
[flake8]
# H301 one import per line
# H302 import only modules
ignore = H301,H302,F401,F812
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools