From d4d826ef9633f2afbc43b1dab1759ca648fde4c8 Mon Sep 17 00:00:00 2001 From: Sahdev Zala Date: Wed, 12 Mar 2014 19:06:04 -0500 Subject: [PATCH] Add .gitreview file and apply cookiecutter template. Add .getreview file and add files generated via cookiecutter template. Also delete some originally added files to have project's initial layout ready. Change-Id: I494f52469b5a4aff1c1f12d58bcf41140ad3e680 --- .coveragerc | 7 + .gitignore | 51 +++++ .gitreview | 4 + .mailmap | 3 + .testr.conf | 7 + CONTRIBUTING.rst | 17 ++ HACKING.rst | 4 + LICENSE | 175 ++++++++++++++++++ MANIFEST.in | 6 + README.rst | 13 ++ babel.cfg | 1 + doc/source/conf.py | 75 ++++++++ doc/source/contributing.rst | 1 + doc/source/index.rst | 24 +++ doc/source/installation.rst | 12 ++ doc/source/readme.rst | 1 + doc/source/usage.rst | 7 + heat-translator/exit.py | 2 - heat-translator/exit.pyc | Bin 331 -> 0 bytes heat-translator/heat/__init__.py | 0 heat-translator/heat/__init__.pyc | Bin 147 -> 0 bytes heat-translator/main.py | 38 ---- heat-translator/source.py | 18 -- heat-translator/source.pyc | Bin 1459 -> 0 bytes heat-translator/tosca/__init__.py | 0 heat-translator/tosca/__init__.pyc | Bin 161 -> 0 bytes heat-translator/tosca/inputs.py | 66 ------- heat-translator/tosca/inputs.pyc | Bin 4060 -> 0 bytes .../tosca/nodetemplates/__init__.py | 0 .../tosca/nodetemplates/__init__.pyc | Bin 157 -> 0 bytes .../tosca/nodetemplates/capabilitytype.py | 0 .../tosca/nodetemplates/capabilitytype.pyc | Bin 168 -> 0 bytes .../tosca/nodetemplates/constraints.py | 87 --------- .../tosca/nodetemplates/constraints.pyc | Bin 5161 -> 0 bytes .../tosca/nodetemplates/node_template.py | 117 ------------ .../tosca/nodetemplates/node_template.pyc | Bin 6852 -> 0 bytes .../tosca/nodetemplates/node_templates.py | 19 -- .../tosca/nodetemplates/node_templates.pyc | Bin 1545 -> 0 bytes .../tosca/nodetemplates/nodetype.py | 29 --- .../tosca/nodetemplates/nodetype.pyc | Bin 1798 -> 0 bytes .../tosca/nodetemplates/nodetypeschema.yaml | 49 ----- .../tosca/nodetemplates/nodetypesdef.yaml | 46 ----- .../tosca/nodetemplates/properties.py | 35 ---- .../tosca/nodetemplates/properties.pyc | Bin 2387 -> 0 bytes .../tosca/nodetemplates/relationshiptype.py | 6 - .../tosca/nodetemplates/relationshiptype.pyc | Bin 746 -> 0 bytes .../tosca/nodetemplates/requirementtype.py | 0 .../tosca/nodetemplates/requirementtype.pyc | Bin 169 -> 0 bytes .../tosca/nodetemplates/rootnodetype.py | 31 ---- .../tosca/nodetemplates/rootnodetype.pyc | Bin 1927 -> 0 bytes heat-translator/tosca/nodetemplates/schema.py | 88 --------- .../tosca/nodetemplates/schema.pyc | Bin 4298 -> 0 bytes heat-translator/tosca/outputs.py | 4 - heat-translator/tosca/outputs.pyc | Bin 525 -> 0 bytes heat-translator/tosca/tests/__init__.py | 0 heat-translator/tosca/tests/__init__.pyc | Bin 167 -> 0 bytes heat-translator/tosca/tests/tosca.yaml | 30 --- heat-translator/tosca/tosca_profile.py | 24 --- heat-translator/tosca/tosca_profile.pyc | Bin 1767 -> 0 bytes heat-translator/tosca/translate.py | 34 ---- heat-translator/tosca/translate.pyc | Bin 1733 -> 0 bytes heat-translator/tosca/validate.py | 20 -- heat-translator/tosca/validate.pyc | Bin 1257 -> 0 bytes heat-translator/utils.py | 26 --- heat-translator/yaml_loader.py | 21 ++- heat-translator/yaml_loader.pyc | Bin 1118 -> 0 bytes openstack-common.conf | 6 + requirements.txt | 2 + setup.cfg | 46 +++++ setup.py | 22 +++ test-requirements.txt | 11 ++ tox.ini | 31 ++++ 72 files changed, 544 insertions(+), 772 deletions(-) create mode 100644 .coveragerc create mode 100644 .gitignore create mode 100644 .gitreview create mode 100644 .mailmap create mode 100644 .testr.conf create mode 100644 CONTRIBUTING.rst create mode 100644 HACKING.rst create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 README.rst create mode 100644 babel.cfg create mode 100755 doc/source/conf.py create mode 100644 doc/source/contributing.rst create mode 100644 doc/source/index.rst create mode 100644 doc/source/installation.rst create mode 100644 doc/source/readme.rst create mode 100644 doc/source/usage.rst delete mode 100644 heat-translator/exit.py delete mode 100644 heat-translator/exit.pyc delete mode 100644 heat-translator/heat/__init__.py delete mode 100644 heat-translator/heat/__init__.pyc delete mode 100644 heat-translator/main.py delete mode 100644 heat-translator/source.py delete mode 100644 heat-translator/source.pyc delete mode 100644 heat-translator/tosca/__init__.py delete mode 100644 heat-translator/tosca/__init__.pyc delete mode 100644 heat-translator/tosca/inputs.py delete mode 100644 heat-translator/tosca/inputs.pyc delete mode 100644 heat-translator/tosca/nodetemplates/__init__.py delete mode 100644 heat-translator/tosca/nodetemplates/__init__.pyc delete mode 100644 heat-translator/tosca/nodetemplates/capabilitytype.py delete mode 100644 heat-translator/tosca/nodetemplates/capabilitytype.pyc delete mode 100644 heat-translator/tosca/nodetemplates/constraints.py delete mode 100644 heat-translator/tosca/nodetemplates/constraints.pyc delete mode 100644 heat-translator/tosca/nodetemplates/node_template.py delete mode 100644 heat-translator/tosca/nodetemplates/node_template.pyc delete mode 100644 heat-translator/tosca/nodetemplates/node_templates.py delete mode 100644 heat-translator/tosca/nodetemplates/node_templates.pyc delete mode 100644 heat-translator/tosca/nodetemplates/nodetype.py delete mode 100644 heat-translator/tosca/nodetemplates/nodetype.pyc delete mode 100644 heat-translator/tosca/nodetemplates/nodetypeschema.yaml delete mode 100644 heat-translator/tosca/nodetemplates/nodetypesdef.yaml delete mode 100644 heat-translator/tosca/nodetemplates/properties.py delete mode 100644 heat-translator/tosca/nodetemplates/properties.pyc delete mode 100644 heat-translator/tosca/nodetemplates/relationshiptype.py delete mode 100644 heat-translator/tosca/nodetemplates/relationshiptype.pyc delete mode 100644 heat-translator/tosca/nodetemplates/requirementtype.py delete mode 100644 heat-translator/tosca/nodetemplates/requirementtype.pyc delete mode 100644 heat-translator/tosca/nodetemplates/rootnodetype.py delete mode 100644 heat-translator/tosca/nodetemplates/rootnodetype.pyc delete mode 100644 heat-translator/tosca/nodetemplates/schema.py delete mode 100644 heat-translator/tosca/nodetemplates/schema.pyc delete mode 100644 heat-translator/tosca/outputs.py delete mode 100644 heat-translator/tosca/outputs.pyc delete mode 100644 heat-translator/tosca/tests/__init__.py delete mode 100644 heat-translator/tosca/tests/__init__.pyc delete mode 100644 heat-translator/tosca/tests/tosca.yaml delete mode 100644 heat-translator/tosca/tosca_profile.py delete mode 100644 heat-translator/tosca/tosca_profile.pyc delete mode 100644 heat-translator/tosca/translate.py delete mode 100644 heat-translator/tosca/translate.pyc delete mode 100644 heat-translator/tosca/validate.py delete mode 100644 heat-translator/tosca/validate.pyc delete mode 100644 heat-translator/utils.py delete mode 100644 heat-translator/yaml_loader.pyc create mode 100644 openstack-common.conf create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100755 setup.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..6d3b4185 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = heat-translator +omit = heat-translator/tests/*,heat-translator/openstack/* + +[report] +ignore-errors = True \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1399c981 --- /dev/null +++ b/.gitignore @@ -0,0 +1,51 @@ +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml +.testrepository + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Complexity +output/*.html +output/*/index.html + +# Sphinx +doc/build + +# pbr generates these +AUTHORS +ChangeLog + +# Editors +*~ +.*.swp \ No newline at end of file diff --git a/.gitreview b/.gitreview new file mode 100644 index 00000000..b27b144a --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=stackforge/heat-translator.git diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..cc92f17b --- /dev/null +++ b/.mailmap @@ -0,0 +1,3 @@ +# Format is: +# +# \ No newline at end of file diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 00000000..fb622677 --- /dev/null +++ b/.testr.conf @@ -0,0 +1,7 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ + OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ + OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ + ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list \ No newline at end of file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 00000000..d8a86f37 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,17 @@ +If you would like to contribute to the development of OpenStack, +you must follow the steps in the "If you're a developer, start here" +section of this page: + + http://wiki.openstack.org/HowToContribute + +Once those steps have been completed, changes to OpenStack +should be submitted for review via the Gerrit tool, following +the workflow documented at: + + http://wiki.openstack.org/GerritWorkflow + +Pull requests submitted through GitHub will be ignored. + +Bugs should be filed on Launchpad, not GitHub: + + https://bugs.launchpad.net/heat-translator \ No newline at end of file diff --git a/HACKING.rst b/HACKING.rst new file mode 100644 index 00000000..9c60464f --- /dev/null +++ b/HACKING.rst @@ -0,0 +1,4 @@ +heat-translator Style Commandments +=============================================== + +Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..67db8588 --- /dev/null +++ b/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..90f8a7ae --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include AUTHORS +include ChangeLog +exclude .gitignore +exclude .gitreview + +global-exclude *.pyc \ No newline at end of file diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..6856fe97 --- /dev/null +++ b/README.rst @@ -0,0 +1,13 @@ +=============================== +heat-translator +=============================== + +Tool to translate non-heat templates to Heat Orchestration Template. + +* Free software: Apache license +* Documentation: http://docs.openstack.org/developer/heat-translator + +Features +-------- + +* TODO \ No newline at end of file diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 00000000..efceab81 --- /dev/null +++ b/babel.cfg @@ -0,0 +1 @@ +[python: **.py] diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100755 index 00000000..c926f2aa --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# 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 os +import sys + +sys.path.insert(0, os.path.abspath('../..')) +# -- General configuration ---------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [ + 'sphinx.ext.autodoc', + #'sphinx.ext.intersphinx', + 'oslo.sphinx' +] + +# autodoc generation is a bit aggressive and a nuisance when doing heavy +# text edit cycles. +# execute "export SPHINX_DEBUG=1" in your terminal to disable + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'heat-translator' +copyright = u'2013, OpenStack Foundation' + +# If true, '()' will be appended to :func: etc. cross-reference text. +add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +add_module_names = True + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# -- Options for HTML output -------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +# html_theme_path = ["."] +# html_theme = '_theme' +# html_static_path = ['static'] + +# Output file base name for HTML help builder. +htmlhelp_basename = '%sdoc' % project + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass +# [howto/manual]). +latex_documents = [ + ('index', + '%s.tex' % project, + u'%s Documentation' % project, + u'OpenStack Foundation', 'manual'), +] + +# Example configuration for intersphinx: refer to the Python standard library. +#intersphinx_mapping = {'http://docs.python.org/': None} \ No newline at end of file diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst new file mode 100644 index 00000000..8cb3146f --- /dev/null +++ b/doc/source/contributing.rst @@ -0,0 +1 @@ +.. include:: ../../CONTRIBUTING.rst \ No newline at end of file diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 00000000..70135124 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,24 @@ +.. heat-translator documentation master file, created by + sphinx-quickstart on Tue Jul 9 22:26:36 2013. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to heat-translator's documentation! +======================================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + readme + installation + usage + contributing + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/source/installation.rst b/doc/source/installation.rst new file mode 100644 index 00000000..5427983c --- /dev/null +++ b/doc/source/installation.rst @@ -0,0 +1,12 @@ +============ +Installation +============ + +At the command line:: + + $ pip install heat-translator + +Or, if you have virtualenvwrapper installed:: + + $ mkvirtualenv heat-translator + $ pip install heat-translator \ No newline at end of file diff --git a/doc/source/readme.rst b/doc/source/readme.rst new file mode 100644 index 00000000..6b2b3ec6 --- /dev/null +++ b/doc/source/readme.rst @@ -0,0 +1 @@ +.. include:: ../README.rst \ No newline at end of file diff --git a/doc/source/usage.rst b/doc/source/usage.rst new file mode 100644 index 00000000..68dd42c7 --- /dev/null +++ b/doc/source/usage.rst @@ -0,0 +1,7 @@ +======== +Usage +======== + +To use heat-translator in a project:: + + import heat-translator \ No newline at end of file diff --git a/heat-translator/exit.py b/heat-translator/exit.py deleted file mode 100644 index acc3fb20..00000000 --- a/heat-translator/exit.py +++ /dev/null @@ -1,2 +0,0 @@ -def write_output(output): - pass \ No newline at end of file diff --git a/heat-translator/exit.pyc b/heat-translator/exit.pyc deleted file mode 100644 index b9e0d337c050000ee6bb6c37dedff208108ab078..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 331 zcmb`B&kDjY48}7R6>;yeix%`MB6#1y-Moy_6*l&#rOlXn_APx3U%+Hj_5ucyetb#u z%k&+t9DWZZ^y%5xa3j1$v2dQl>@Q;$U*e z^B0kuS_@-!<58+objFq5N~Hxl+4xGLap`U^yi+3A5;vnQ^sT_Hz2lnpbgn?14hV*O cJ`jSq$6weP!M*w$eM!3ywaMB_AA2%`KPeMTfdBvi diff --git a/heat-translator/heat/__init__.py b/heat-translator/heat/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/heat-translator/heat/__init__.pyc b/heat-translator/heat/__init__.pyc deleted file mode 100644 index 011e763e57bbf62a6436e313c70e3f2c6836fa41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmZSn%*(Yt{%=q+0~9av^yA|*^D;}~+R{~^2p diff --git a/heat-translator/main.py b/heat-translator/main.py deleted file mode 100644 index e06beec1..00000000 --- a/heat-translator/main.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -import exit -import os -import sys -from source import Source -from tosca.translate import TOSCATranslator -from tosca.tosca_profile import Tosca -from tosca.validate import ToscaValidator - - -def main(): - sourcetype = sys.argv[1] - path = sys.argv[2] - #sourcetype = "tosca" - #path = "/heat-translator/tosca/tests/tosca.yaml" - if not sourcetype: - print("Translation type is needed. For example, 'tosca'") - if not path.endswith(".yaml"): - print "Only YAML file is supported at this time." - - if os.path.isdir(path): - print('Translation of directory is not supported at this time : %s' % path) - elif os.path.isfile(path): - heat_tpl = translate(sourcetype, path) - exit.write_output(heat_tpl) - else: - print('%s is not a valid file.' % path) - -def translate(sourcetype, path): - tpl = Source(path) - if sourcetype == "tosca": - tosca = Tosca(tpl) - ToscaValidator(tosca).validate() - return TOSCATranslator(tosca).translate() - -if __name__ == '__main__': - main() diff --git a/heat-translator/source.py b/heat-translator/source.py deleted file mode 100644 index 5a55aeab..00000000 --- a/heat-translator/source.py +++ /dev/null @@ -1,18 +0,0 @@ -from yaml_loader import Loader - -class Source(object): - def __init__(self, path): - self.profile = Loader(path).load() - - def __contains__(self, key): - return key in self.profile - - def __iter__(self): - return iter(self.profile) - - def __len__(self): - return len(self.profile) - - def __getitem__(self, key): - '''Get a section.''' - return self.profile[key] diff --git a/heat-translator/source.pyc b/heat-translator/source.pyc deleted file mode 100644 index d2f832febf505cccdd0e5cacc3f8a16c98aa256f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmcgs!EVz)5FOiT3WcIxd+X6cqLx715JFUl3+ll+k;`bYH^hnUjl5f-O5Dmf@S}VH zythtL2~J1^J2RQxwdcKgJKpTa=}G(jcvi{w%JBaN=AXjV_$AVcbcxIpN$ON=DvLzw zOumWSiF}-AQcq--AK~%lC$2m}6sB+=oT=>)!6@TRE}qzu{8`p1rco10S&6Kt`%+j?$$BE|k~sp0 zYkPYT!jF+#wQ_whP488y+m1B3&{)G2=SiA-0n%|hcKYuHZh{>~_OTAKKM3os%s^8; zA+xQ_f5(`*wzmHtgej{kz*H&XjxTBNEGqm66Jt-HInGCY{S!>Sx8cHEcw2?W^_Q{l ze`}MH7za_Cq*OoKfbH#6&oCSdNONLto4z-lRSnz@)y~y7Erumejgs3{a-n3ql~mxK zXpH{dCs?uvxU-&s)8t_`-q(5jmRQTJ>00F}fo8>UJlfo+6~v8iABeZ;tYx0aT Ho~6G436ebo diff --git a/heat-translator/tosca/__init__.py b/heat-translator/tosca/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/heat-translator/tosca/__init__.pyc b/heat-translator/tosca/__init__.pyc deleted file mode 100644 index 78c4f95e03682cd1b08933352a6d08392aa88ebc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 161 zcmZSn%*(YreSJ_e0~9a1^fU5vQ}y!;QuB&S z5|gv_%kzt}iwhEyQ}r`a6H9bUiW2jRa}rDPi{dTyi;I%=OY)186XS~uQj;^&GL!Y= g<1_OzOXB183MxxDfX3P6=BJeAq}qWjEe2u+0EPG`I{*Lx diff --git a/heat-translator/tosca/inputs.py b/heat-translator/tosca/inputs.py deleted file mode 100644 index d5322907..00000000 --- a/heat-translator/tosca/inputs.py +++ /dev/null @@ -1,66 +0,0 @@ -from tosca.nodetemplates.schema import Schema -from tosca.nodetemplates.constraints import Constraint - -class InputParameters(object): - def __init__(self, inputs): - self.inputs = inputs - - def __contains__(self, key): - return key in self.inputs - - def __iter__(self): - return iter(self.inputs) - - def __len__(self): - return len(self.inputs) - - def __getitem__(self, key): - '''Get a input value.''' - return self.inputs[key] - -class Input(object): - - def __init__(self, name, schema): - self.name = name - self.schema = schema - - def get_type(self): - return self.schema['type'] - - def get_description(self): - if self.has_default(): - return self.schema['description'] - return '' - - def get_default(self): - if self.has_default(): - return self.schema['default'] - return '' - - def get_constraints(self): - return self.schema['constraints'] - - def has_default(self): - '''Return whether the parameter has a default value.''' - return Schema.DEFAULT in self.schema - - def has_description(self): - '''Return whether the parameter has a default value.''' - return Schema.DESCRIPTION in self.schema - - def validate(self): - self.validate_type(self.get_type()) - self.validate_constraints(self.get_constraints()) - - def validate_type(self, input_type): - if input_type not in Schema.TYPES: - raise ValueError('Invalid type %s' % type) - - def validate_constraints(self, constraints): - for constraint in constraints: - for key in constraint.keys(): - if key not in Constraint.CONSTRAINTS: - raise ValueError('Invalid constraint %s' % constraint) - if isinstance(key, dict): #and is_required to have a min or max or in certain range or equal to something etc. - pass - \ No newline at end of file diff --git a/heat-translator/tosca/inputs.pyc b/heat-translator/tosca/inputs.pyc deleted file mode 100644 index 5697c2f5518ee695fb6e5edd2505e9018cf5035e..0000000000000000000000000000000000000000 GIT binary patch literal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k?RV zP^nvzDYTnwokTz2Wj|y^|9IIz_#U45D-=sclJZip2Cv*0`D8+|S?G}piRb6LJXMXD zsB6H(S0V2mGwgH({}^&kCn1bWM7^r^5RC&wYA}i(rY?Nc237%l#q@){hGG?92kLQ( z4m4zL(n)}KxB{>m3^oPd9gIyM2M&AIc@lUN&rz%(c8kP)oFY?CE_6N}1zf3f2&p!+6Yoo@0(n@j_;F9OY6w2^w}&}M_5Vb2X4H^;3Ps3xz9IX!1Va)N z4kM=6#|yzL5elgmz2j1q8tyE8w`G}!3NT^+1Dx& z{YsneT-Yup^U;?;}x_=Z)W)}x!u6PYpcunUDVHLuGvt_ z@IM}Uv~`Sx`ZE0POp<-q>i>yW1fWy+1bVMx^IX>E3!~^8DqH7`!8kT|6A~M5bCw%@HCG2Ge_wEzOWXOP?i@43 zi~_(823Gr8cqs?bM$wJh3&4hu^xB&tD#5v+y}HLgpb1X%BbdNo*YVR9?O_epbxTqO-9nXJ3lu!puW+{nb_){dw?;fGqPT zM213fx1QA0|Hmz3ye< diff --git a/heat-translator/tosca/nodetemplates/nodetype.py b/heat-translator/tosca/nodetemplates/nodetype.py deleted file mode 100644 index 93a02aa3..00000000 --- a/heat-translator/tosca/nodetemplates/nodetype.py +++ /dev/null @@ -1,29 +0,0 @@ -from rootnodetype import RootNodeType - -class NodeType(RootNodeType): - def __init__(self, nodetype): - super(NodeType, self).__init__() - self.nodetype = nodetype - - ''' get properties for a given node type''' - def get_properties(self): - properties = [] - nodetype = self.get_nodetype() - for prop_key, prop_vale in nodetype.iteritems(): - if prop_key == 'properties': - properties = prop_vale - return properties - - ''' get capabilities for a given node type''' - def get_capabilities(self): - pass - - def derived_from(self): - pass - - def set_requirements(self): - pass - - def get_requirements(self): - return self.requirements() - \ No newline at end of file diff --git a/heat-translator/tosca/nodetemplates/nodetype.pyc b/heat-translator/tosca/nodetemplates/nodetype.pyc deleted file mode 100644 index 387641a2d9035940c24668a1830b0e1775178faa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1798 zcmd5-!EVz)5S_J?(3A#MAS4in!p-71X>w;Q{33Gv%4uoN>1>{ zd;q)|CrwYB2x{V)>`v^N_ulS~!(W5L-n=);X!8m2`wHfs!{xXXl|+@Iu_BcRWE4#l z)gCwHpU+yu$^2N<6B?D+!>r9u7Q%s z%vqHTLPAlFbT&oDT`tIx9_3vb+@WL?^^hV9;MkbOIm|tU^SBhPfH$DafKjWJ%r%k| zurrKd)Zts1hFdhoCPITzYhBC=ueDH^fsY5Dh^u&h#F=uE@F0S<&b`AZ{#sWit{XFR zKFy}_x7to!lV&FNHl4XL^|jTfr?InH>}!{$vE(*YgTIVxXQ=d|Std+JYOy2rKxK@M zv0f8>i^&DiT8LfB+N=Zm9@7e>6_bAR`5Ao*XdTkJLn}~MG!4j}(5l0a%}@CH0A)r( zZs-q@vaw)bePLY7nAi2fc)iuZ_Yo+(v9QX?E=U+x!pkADh-{ojPt8(pm&sLHn*Ax} z?`?4I@H0@y@JaR5k$Mapv^uhuZ09h?3g^2`ff>pE5LSBxe2hXYY?e0Zm!d3K^81K6 z-e`1-fU<-+*89rjdSdJ9;cW!TYC5QC&3sWMsgRigz+Z>c6=rhR%W-2W%SS673;>0 tNse1j^}GFkKjiN);;_6NEM5-VCXygX(s1{TOeA~Rigd;(<#Zhfe*ji0o45b~ diff --git a/heat-translator/tosca/nodetemplates/nodetypeschema.yaml b/heat-translator/tosca/nodetemplates/nodetypeschema.yaml deleted file mode 100644 index ebbc7b16..00000000 --- a/heat-translator/tosca/nodetemplates/nodetypeschema.yaml +++ /dev/null @@ -1,49 +0,0 @@ -tosca_nodes_Compute: - num_cpus: - required: no - type: integer - constraints: - - greater_or_equal: 1 - description: > - Number of (actual or virtual) CPUs associated with the Compute node. - disk_size: - required: no - type: integer - constraints: - - greater_or_equal: 0 - description: > - Size of the local disk, in Gigabytes (GB), available to applications running on the Compute node. - mem_size: - required: no - type: integer - constraints: - - greater_or_equal: 0 - description: > - Size of memory, in Megabytes (MB), available to applications running on the Compute node. - os_arch: - required: no - default: x86_64 - type: string - description: > - The host Operating System (OS) architecture. - os_type: - required: yes - type: string - description: > - The host Operating System (OS) type. - os_distribution: - required: no - type: string - description: > - The host Operating System (OS) distribution. Examples of valid values for an “os_type” of “Linux” would include: - debian, fedora, rhel and ubuntu. - os_version: - required: no - type: integer - description: > - The host Operating System version. - ip_address: - required: no - type: string - description: > - The primary IP address assigned by the cloud provider that applications may use to access the Compute node. diff --git a/heat-translator/tosca/nodetemplates/nodetypesdef.yaml b/heat-translator/tosca/nodetemplates/nodetypesdef.yaml deleted file mode 100644 index 003349c1..00000000 --- a/heat-translator/tosca/nodetemplates/nodetypesdef.yaml +++ /dev/null @@ -1,46 +0,0 @@ -tosca_nodes_Root: - properties: - - property - capabilities: - - capability1: somecapbility - interfaces: - - create - - start - - stop - - install - - delete - -tosca_nodes_Compute: - derived_from: tosca_nodes_Root - properties: - - num_cpus - - disk_size - - mem_size - - os_arch - - os_type - - os_version - - ip_address - requirements: - - host: none - - database: none - capabilities: - container: - type: Container - containee_types: [tosca_nodes_SoftwareComponent] - -tosca_nodes_SoftwareComponent: - derived_from: tosca_nodes_Root - requirements: - - host: tosca.nodes.Compute - capabilities: - containee: - type: Containee - container_types: [tosca.nodes.Compute] - -tosca.nodes.MySQL: - derived_from: tosca_nodes_SoftwareComponent - properties: - - db_user - - db_pwd - - db_root_pwd - \ No newline at end of file diff --git a/heat-translator/tosca/nodetemplates/properties.py b/heat-translator/tosca/nodetemplates/properties.py deleted file mode 100644 index 190e1854..00000000 --- a/heat-translator/tosca/nodetemplates/properties.py +++ /dev/null @@ -1,35 +0,0 @@ -from tosca.nodetemplates.schema import Schema -from tosca.nodetemplates.constraints import Constraint - -class Property(object): - def __init__(self, name, nodetype, value): - self.name = name - self.nodetype = nodetype - self.value = value - - def is_required(self): - return Schema(self.nodetype).is_required(self.name) - - def get_name(self): - return self.name - - def validate(self): - self.validate_data_type() - self.validate_constraints() - - def validate_data_type(self): - data_type = Schema(self.nodetype).get_type(self.name) - if data_type == Schema.STRING: - return Constraint.validate_string(self.value) - elif data_type == Schema.INTEGER: - return Constraint.validate_integer(self.value) - elif data_type == Schema.NUMBER: - return Constraint.validate_number(self.value) - - def validate_constraints(self): - constraints = Schema(self.nodetype).get_constraints(self.name) - if constraints: - for constraint in constraints: - Constraint(self.name, self.value, constraint).validate() - pass - diff --git a/heat-translator/tosca/nodetemplates/properties.pyc b/heat-translator/tosca/nodetemplates/properties.pyc deleted file mode 100644 index 1b446c01d244a66092281cde6f191ae770719ac8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2387 zcmc&$O;6iE5S_J?Ktd@|)k8m2RcbH3fTgM@RG|ur5Qj#s0aZjoma(_s5Zl4KX+eTh z`tSO4`UBc|<9wl(V%5~OyiHs|KD>n>)a*$r>IYqDe5Xx z7(3K=D08Xn^4KL^qpymR8vP&|5gm5xl+&GoI=5ao7~I>cbb5J0q{9p2e4qczyqU3j0FZCFIc(_;K0lR1r?mQ z#_vIMxNUJWFS)x?bVU@h;fTRQR}4OcF$>&|2e()}n@5=zxOtIidpXdy&a>a5{!n{Z zmrX|ZzXo_Dz*K-89=ED9M{N10MW%fw%r1!HGyi*0o|!=uYo9%mn|@@AGJNyaH)ZUf z>d3CnrhQwOIP&Fuoeg-aHvXV;UaHO7;8O5~VVb8l3~{)D`$;wV8^fz;Qzty-fo1wc zJw+o$J@G@&g*~A!GkAdxR{}Ing$Rl$IIGt$ z``bI)fd%*JCN6&ZgsUF%rgQLdlh<#&Bp+tSy7b@~$t~MtYZ~G^%`{{gBxN3QN9ws+ zQSEV)qJnydVk231z{YJwrHWwrnJ!il$`41c=-NTyguZ$tpw&>6^ae0Ov+hXwVgku CV<`{- diff --git a/heat-translator/tosca/nodetemplates/relationshiptype.py b/heat-translator/tosca/nodetemplates/relationshiptype.py deleted file mode 100644 index 11a96348..00000000 --- a/heat-translator/tosca/nodetemplates/relationshiptype.py +++ /dev/null @@ -1,6 +0,0 @@ -from rootnodetype import RootRelationshipType - -class RelatonshipType(RootRelationshipType): - def __init__(self, relatointype): - super(RelatonshipType, self).__init__() - self.nodetype = relatointype \ No newline at end of file diff --git a/heat-translator/tosca/nodetemplates/relationshiptype.pyc b/heat-translator/tosca/nodetemplates/relationshiptype.pyc deleted file mode 100644 index 08a031dc3b6e85b8780fbcf84a982c25c3c375e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 746 zcmcJM!A`?442GR{Ludj40&zp)SaBfI&Ilp6@6d8#m#Atpt*mXTCKH;p8@w?O0KdIK zpI}kq#&#Tk`5S+qPOfjpSwZ^|pWDh^~}RVOKg!Mtqb({kpS#Dxk-3jj7ry7!%lOU1?l@fs(%)#(j nJ_hnE)RCI)=tL*{_&*s_BuS(mkPa%F=<~2szbil0~$f diff --git a/heat-translator/tosca/nodetemplates/requirementtype.py b/heat-translator/tosca/nodetemplates/requirementtype.py deleted file mode 100644 index e69de29b..00000000 diff --git a/heat-translator/tosca/nodetemplates/requirementtype.pyc b/heat-translator/tosca/nodetemplates/requirementtype.pyc deleted file mode 100644 index 92d223e0ae6e4a5c132c31a5f492ddf89d03dfe5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmZ9Fu?hk~3`AG75W!EdzskVXB7T9zSz5@l8&K|c6O$Zr-)$|J11kgb24*0$d~Y|q z>!(ZMcMJEEOIMB@!ljv$bK?kq(9ScsQ$ZlcsuoiZFOpt4CIpjMb%;iCYgIH8|)}JP12j znlf%4yulfU-GiAEjU|0JT6P*pg8h(}xw|mh8m9#=19a<{T1G7yyuCHWD8x63v9I9$ zD=7`qUz~JU&m5OP>%7dJ);;)^&n30(NoqcP9+KJ#oC~5$MGjfOqWT^+$Mo$fhph}= zeAuH)kLHLwG#7oS&rj%W30f3N&Sdq&F09*t$!*TnEmI@KSs>FWnPVhbo;typJJU?e z%!){o8luQTMi%p`m_5e^OIAx*%q6^oVHrNDKy9l%wXag1XDp2348xwo!=CCE?(x&PB-xvs9kWo zrTQWFg&U!k$<$~q($RWaWnT(}F{78l#C*46zJs^u#aqSQiMarb&9Vv9dS|`o_Th4i zi4B@iUX}J!UjNZ*_@z^R=^o5qtp;6%A1}KK2cjjeEF`qJK8Q$GN(FCIT}hTq?jsD# z3MbXxI!W_BV&VQ4!Rp99z+n$D1V#W=tRZlG6S=kPLVh=5gyfjnh5Wgb=uuu6X(zl& l^e=6s`ZzYJlQPD<{eMV9WPIET_c@o>avD1x#O@s&`~tfyyjlPN diff --git a/heat-translator/tosca/nodetemplates/schema.py b/heat-translator/tosca/nodetemplates/schema.py deleted file mode 100644 index 4e0c2d8a..00000000 --- a/heat-translator/tosca/nodetemplates/schema.py +++ /dev/null @@ -1,88 +0,0 @@ -from yaml_loader import Loader -import os - -schema_file = os.path.dirname(os.path.abspath(__file__)) + os.sep + "nodetypeschema.yaml" -schema = Loader(schema_file).load() - -class Schema(object): - - TYPES = ( - INTEGER, - STRING, NUMBER, BOOLEAN, - LIST - ) = ( - 'integer', - 'string', 'number', 'boolean', - 'list' - ) - - KEYS = ( - TYPE, DESCRIPTION, DEFAULT, CONSTRAINTS, - ) = ( - 'type', 'description', 'default', 'constraints' - ) - - def __init__(self, nodetype): - self.nodetype = nodetype - self.nodes = self._set_nodes() - - '''set a list of node names from the schema''' - def _set_nodes(self): - sections = [] - if isinstance(schema, dict): - for key in schema.iterkeys(): - sections.append(key) - return sections - - def _get_section(self, section_name): - section = {} - if section_name in self.nodes: - return schema[section_name] - return section - - ''' return true if property is a required for a given node ''' - def is_required(self, property_name): - return property_name in self.required() - - ''' get schemata for a given node type''' - def get_schemata(self): - ntype = self.nodetype - ntype = ntype.replace(".", "_") - return self._get_section(ntype) - - ''' get schema for a given property''' - def get_schema(self, property_name): - schema = {} - schemata = self.get_schemata() - for prop_key, prop_vale in schemata.iteritems(): - if prop_key == property_name: - for attr, value in prop_vale.iteritems(): - schema[attr] = value - return schema - - def get_type(self, property_name): - return self.get_schema(property_name)['type'] - - def get_constraints(self, property_name): - s = self.get_schema(property_name) - if 'constraints' in s: - s['constraints'] - - def get_description(self, property_name): - return self.get_schema(property_name)['description'] - - def get_greater_or_equal(self, property_name): - pass - - def get_equal(self, property_name): - pass - - ''' list all the required properties for a given nodetype ''' - def required(self): - required = [] - schemata = self.get_schemata() - for prop_key, prop_vale in schemata.iteritems(): - for attr, value in prop_vale.iteritems(): - if attr == 'required' and value: - required.append(prop_key) - return required \ No newline at end of file diff --git a/heat-translator/tosca/nodetemplates/schema.pyc b/heat-translator/tosca/nodetemplates/schema.pyc deleted file mode 100644 index 5c558477f781f709358b519b6f3085420df6b279..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4298 zcmdT{>rxy=6h5;zST2D8fuPZ7jLAj~Ygv|+ACx9sOkv1^v!p1tlA0QJ8W`9c(}P0Q z?k{`*-@(W6aeM&%zB4Ed)G}f+a-5apT*~Cd6y(z3!>JKj2(q$J8x@0rQ4Sv$+1+gWfr%=17JRE6nE0Y&Z2ibI{iO@P+0Zpr z?O!R8$I=xv`x}VCp4jS^b%C^p$`xxbl{dT)y{8pR;-w1823~dsRVsZsC(Ywy^aK)~0P0yuAa`b)+lefe|@|CzbIs41=orqf*LZSv(4odLkY} z$FnB(IAUX(UbzxKufkc=IB+Rk2`wRZ4_x`E-8AKP$3QH|m*}<$h3fE>u9z3tM6Ad5hS|GLFP4I#ZcC zhZwXS=EAEAk@snd@(rl?ptEc3Y& z*zZFMK;Mc}aHgDDXU@@}p)B;Qn(kvTAxx)+VbDO%fWPtekI47e}8Wnwp;&@T~sd#Kv)z}hUi`jLpMktF+$FRrJ)_ z+^Fs-^J0CkstmuR_nEcz>Z-f3y|b}Z(bv}2zkl{>b4TY^w<`GdGwfA$313>%Y60Tj zVOJeW|G1AxJ||&8x@$La|t6FN^{#kIeWYZk_d!=85#s*`xaSkuujCO0Xa s(Xa61Nx{L3RD1szHxrlAUPricL%7y0CsFk+ch>@a+L_2aa%M7r0kMI{T>t<8 diff --git a/heat-translator/tosca/outputs.py b/heat-translator/tosca/outputs.py deleted file mode 100644 index 94a6a04e..00000000 --- a/heat-translator/tosca/outputs.py +++ /dev/null @@ -1,4 +0,0 @@ - -class Outputs(object): - def __init__(self): - pass diff --git a/heat-translator/tosca/outputs.pyc b/heat-translator/tosca/outputs.pyc deleted file mode 100644 index c702c9b74e66e6cde98ca4653f35a1a61a3222b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 525 zcmb_YOKQU~5FI(i4S_DQ?Fqc9AnOo9x=+AfH5;MI3Q7Et@r)^5w>RzuIwSRSfL1V1 znt5-2ntj|YnsZ(`_&PJbw`_RNPy={?lY&~oJHQ*j(~+GFszP*h%W#-zm%SFKxcJGV?GS8H0J`wT>1+cBWqyB04lAN$li9|7+OSS7wV~H sw-nv)Ao2C*X-erWh2s>t+85$b&Jdoj-cc0%ch~p_>$KP=cISTZ37D~Q`~Uy| diff --git a/heat-translator/tosca/tests/__init__.py b/heat-translator/tosca/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/heat-translator/tosca/tests/__init__.pyc b/heat-translator/tosca/tests/__init__.pyc deleted file mode 100644 index 2b03e287e0dd0a4cb32b16030bc398de8281ccab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmZ9FO9}!(3`ARWA%gdqjb<%~c!ELn03q~5r - TOSCA simple profile that just defines a single compute instance. Note, this example does not include inputs values. - -inputs: - cpus: - type: integer - description: cpu - constraints: - - valid_values: [ 1, 2, 4, 8 ] - -node_templates: - my_server: - type: tosca.nodes.Compute - properties: - # compute properties (flavor) - disk_size: 10 - num_cpus: { get_input: cpus } - mem_size: 4096 - # host image properties - os_arch: x86_64 - os_type: Linux - os_distribution: Ubuntu - os_version: 12 - -outputs: - instance_ip: - description: The IP address of the deployed instance. - value: { get_property: [my_server, ip_address ] } \ No newline at end of file diff --git a/heat-translator/tosca/tosca_profile.py b/heat-translator/tosca/tosca_profile.py deleted file mode 100644 index d702ccc9..00000000 --- a/heat-translator/tosca/tosca_profile.py +++ /dev/null @@ -1,24 +0,0 @@ -SECTIONS = (VERSION, DESCRIPTION, INPUTS, - NODE_TEMPLATES, OUTPUTS) = \ - ('tosca_definitions_version', 'description', 'inputs', - 'node_templates', 'outputs') - -class Tosca(object): - - def __init__(self, sourcedata): - self.sourcedata = sourcedata - - def get_version(self): - return self.sourcedata[VERSION] - - def get_description(self): - return self.sourcedata[DESCRIPTION] - - def get_inputs(self): - return self.sourcedata[INPUTS] - - def get_nodetemplates(self): - return self.sourcedata[NODE_TEMPLATES] - - def get_outputs(self): - return self.sourcedata[OUTPUTS] \ No newline at end of file diff --git a/heat-translator/tosca/tosca_profile.pyc b/heat-translator/tosca/tosca_profile.pyc deleted file mode 100644 index 03b1d4b318303a0804ea73100f21c20ef7f1b187..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1767 zcmcJP+iuf95QfKb4sD^FgoN@2zQR(uMHP_xB2r1BwTpy>v@+fexJ|s4cLPG|9Xtf@ z$qO+5CTVlsHi>pTd;Vs2X2O5RN9TVBX-S)3kH7D@**7fI0d;etFFncw$~%;Yly@ob zk?N7|(>x&6r$0o$i9Y88QUgk(L*D0x5XP2;RC-?3m8(o`#>4JKTl z`&HenoOMrFt&P&s>1DGhoVISjLuTdtH0Uy%d&3*>$Omrrl!YdMDgqPZs=zBDsg75= zq(ZN-0bQ^3VF?xwNTd-s$_|Td8{yz%7S{n?6G_GypKh>s0u{k|XLJO^crv@l)(^2KXCofr>~%UlzYj31olMUX znI#`*=kK#*ui!uhIFkP+_g~(JAJII$$oB2=ZFp}=)T>+M2-&$w*Sc70DSf$+a%t3R z!Cip`0#7C$L%`$W8N>?~x0&d*2Pz)|B^0q}ab>@A7;gWQ2vdR^Ss1kw_`(;B5HmZ~ x_}0EO86h20f#NT)S)ghPfgc5S_L2QHN9&a6lj-_2>h^B~@>zqJ&CtX(cD?5_KLyZ7T;H%e)Fx%_^^rq9@A{0Pd4Vg?Syf|Nsw zu}jwuH3Q(8OL2=z&*C=ll;?LSYmw^GL{QeIuSC~GALA{Ai~J6Up8n+PME4jD_g?J} z_6`Qaee-~uqbQlEck`lFjoIP$_%s?Fjhm#@d19(&#Z>UvTQ+^jj)^ck=F7i|9sCBs z1#5s7Cgl=4rGWc+m;-hSPW>K_$^Fr zv(t0t9ir20v6FIIPK}gy%v3r}eEh;-zE=4p1n}7w&T0wHt3m};tx9c@^dk6DH5a;0 zQWcn07UXak=q3$p$W_03Szm^rzs;r*n#5y~g3XOtVK2CYCCzME1dv!LW3<$03k$W` z9g&atTX{o7$E zh%4Tpt5F~lJ$wI|B&2UmJm&r*Y9Thn6E=;tL4PUOf8^3-2G8yZ7Zm9EJ>i1ov-_Ki z4{pmXUM7X&EsnEH%A(5VIXCS-4AE!H8zQeEJ_-@ZXIpcd*!S4seKrl(5njvdcrI?= zu6!(^%cRH+&W88LM`L+*97Z2bPa*?q=ZQ{?X+nl%k73M}+2R<6inUW2D(tYSbAz>8 geVVD%*i&!w!fcXXFVcDlkyc>e={P&0?|A(F1)^GW;s5{u diff --git a/heat-translator/tosca/validate.py b/heat-translator/tosca/validate.py deleted file mode 100644 index fdcfeee3..00000000 --- a/heat-translator/tosca/validate.py +++ /dev/null @@ -1,20 +0,0 @@ -from tosca.inputs import Input -from tosca.nodetemplates.node_template import NodeTemplate - -class ToscaValidator(): - def __init__(self, Tosca): - self.inputs = Tosca.get_inputs() - self.nodetemplates = Tosca.get_nodetemplates() - self.tosca = Tosca - - def validate(self): - #validate inputs - for name, attrs in self.inputs.iteritems(): - if not isinstance(attrs, dict): - print ("The input %s has no attributes", name) - Input(name, attrs).validate() - - #validate node templates - for nodetemplate, value in self.nodetemplates.iteritems(): - NodeTemplate(nodetemplate, value, self.tosca).validate() - \ No newline at end of file diff --git a/heat-translator/tosca/validate.pyc b/heat-translator/tosca/validate.pyc deleted file mode 100644 index 155f723aa18631a1e06e013c2865905125fca55d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1257 zcmb_bPjAyu4EKBKpKW4WIU%75mBXY+NR6}u2x%Y$NWg&}(u#=+6hiVw(=|znT^Le( zDpx)cABztFw$qkzW=WrGzxQna{Ilcz+TT0;*&ZaYemwqv!V4d;Ncm@A3XmHZ88Bj7 zm|Dm^7xn8a`5X_m%RR$DmY|CATrX5m0kFbGaJvI0#M55j?O`8W}=S)^l44bW9cyp_KxY;KaQamp8x;= diff --git a/heat-translator/utils.py b/heat-translator/utils.py deleted file mode 100644 index edce3fc3..00000000 --- a/heat-translator/utils.py +++ /dev/null @@ -1,26 +0,0 @@ -import numbers - -def validate_integer(value): - if not isinstance(value, (int, long)): - raise TypeError('value is not an integer for %s' %value) - return validate_number(value) - -def validate_number(value): - return str_to_num(value) - -def validate_string(value): - if not isinstance(value, basestring): - raise ValueError(_('Value must be a string')) - return value - -def validate_list(self, value): - pass - -def str_to_num(value): - '''Convert a string representation of a number into a numeric type.''' - if isinstance(value, numbers.Number): - return value - try: - return int(value) - except ValueError: - return float(value) \ No newline at end of file diff --git a/heat-translator/yaml_loader.py b/heat-translator/yaml_loader.py index 4f06886f..9642895f 100644 --- a/heat-translator/yaml_loader.py +++ b/heat-translator/yaml_loader.py @@ -1,10 +1,25 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# +# 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 yaml if hasattr(yaml, 'CSafeLoader'): yaml_loader = yaml.CSafeLoader else: yaml_loader = yaml.SafeLoader - + class Loader(object): def __init__(self, file_name): @@ -12,9 +27,9 @@ class Loader(object): def load(self): f = open(self.file_name, 'r') - profile = f.read() # string + profile = f.read() try: doc = yaml.load(profile, Loader=yaml_loader) except yaml.YAMLError as error: raise ValueError(error) - return doc \ No newline at end of file + return doc diff --git a/heat-translator/yaml_loader.pyc b/heat-translator/yaml_loader.pyc deleted file mode 100644 index 6f023fae0fea201908a30eea69bcc034cf948f82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1118 zcmcIjO^?$s5Pgo*E-hU^+?FF3a)C&2MTlj^1uZ?K60qf9Oya5^X;Rs)P^I=l`3w9~ zegMo&7m7G9Q9XH1oS8T8P4$n{{`&jLsKoW9>Hd;dctfG0pF$0c0jJ<-n_!>7KVm#j zFxF^#f>XwohU;LWP^I_=?18Isms5y z{>asng0p0_4nZWyr|r_^?aDPF+H#S9Y5gLsZ0YjoZ4+u6TW_8|%Y!fTsk8C%@o~Pf z%i7e^GS|Ew3Z^er5s2# zd5SIRksx-kS8Av6zIlk0-*mC)!+(U@rBLw%+mue=t3spjVXMgyO+|*0Yx{y@#`HuA zZdRm_op-hpz}*Poj>N>j`V(2N&fi|X_P+Iz+k0p0wUe!wUvNRGHz7X2%C~F-ktL7X zl3F0A`Q!g)K*84YY=k=$pzf=I(&~)v_f*C+aP1HehB4BEG0V1E)3BI=4@ib1KS4J< zCE^7W4P3CRdOBmZ3UPf2a2I+?Da*D<3>^zG1o|+4F-)FL;as M6CEUX)gbBVUnAr5%K!iX diff --git a/openstack-common.conf b/openstack-common.conf new file mode 100644 index 00000000..93a04589 --- /dev/null +++ b/openstack-common.conf @@ -0,0 +1,6 @@ +[DEFAULT] + +# The list of modules to copy from oslo-incubator.git + +# The base module to hold the copy of openstack.common +base=heat-translator \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..86463419 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pbr>=0.5.21,<1.0 +Babel>=0.9.6 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..b09e3f33 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,46 @@ +[metadata] +name = heat-translator +summary = Tool to translate non-heat templates to Heat Orchestration Template. +description-file = + README.rst +author = OpenStack +author-email = openstack-dev@lists.openstack.org +home-page = http://www.openstack.org/ +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + 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 :: 2.6 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.3 + +[files] +packages = + heat-translator + +[build_sphinx] +source-dir = doc/source +build-dir = doc/build +all_files = 1 + +[upload_sphinx] +upload-dir = doc/build/html + +[compile_catalog] +directory = heat-translator/locale +domain = heat-translator + +[update_catalog] +domain = heat-translator +output_dir = heat-translator/locale +input_file = heat-translator/locale/heat-translator.pot + +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = heat-translator/locale/heat-translator.pot \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100755 index 00000000..2a0786a8 --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# 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. + +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools + +setuptools.setup( + setup_requires=['pbr>=0.5.21,<1.0'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..3434db12 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,11 @@ +hacking>=0.5.6,<0.8 + +coverage>=3.6 +discover +fixtures>=0.3.14 +python-subunit +sphinx>=1.1.2 +oslo.sphinx +testrepository>=0.0.17 +testscenarios>=0.4,<0.5 +testtools>=0.9.32 \ No newline at end of file diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..167b0130 --- /dev/null +++ b/tox.ini @@ -0,0 +1,31 @@ +[tox] +minversion = 1.6 +envlist = py26,py27,py33,pypy,pep8 +skipsdist = True + +[testenv] +usedevelop = True +install_command = pip install -U {opts} {packages} +setenv = + VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = python setup.py testr --slowest --testr-args='{posargs}' + +[testenv:pep8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + +[testenv:cover] +commands = python setup.py testr --coverage --testr-args='{posargs}' + +[flake8] +# H803 skipped on purpose per list discussion. +# E123, E125 skipped as they are invalid PEP-8. + +show-source = True +ignore = E123,E125,H803 +builtins = _ +exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build \ No newline at end of file