From a331dfadfe68047d8d579feb993f302cd3019612 Mon Sep 17 00:00:00 2001 From: Sahdev Zala Date: Sat, 6 Aug 2016 12:06:20 -0700 Subject: [PATCH] =?UTF-8?q?The=20=E2=80=94template-type=20is=20no=20longer?= =?UTF-8?q?=20required=20arg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The translator by default uses tosca as a value to the --template-type arg. The --template-type arg which used to be a required arg is an optional arg and needs to be reflected in the doc. Change-Id: Idb9da528ea9e08c331e554c0167ac449f9f9a6e3 Closes-Bug: #1610581 --- doc/source/usage.rst | 11 +++++------ translator/shell.py | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/source/usage.rst b/doc/source/usage.rst index e8f132ab..fb52780d 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -12,7 +12,8 @@ Assuming that OpenStackClient (OSC) is available in your environment, you can ea Alternatively, you can install a particular release of Heat-Translator as available at https://pypi.python.org/pypi/heat-translator. -Once installation is complete, Heat-Translator is ready to use. Currently you can use it in following three ways. +Once installation is complete, Heat-Translator is ready to use. The only required argument is ``--template-file``. By default, the ``--template-type`` is set to ``tosca`` which is the +only supported template type at present. Currently you can use Heat-Translator in following three ways. Translate and get output on command line. For example: :: @@ -39,15 +40,13 @@ Heat-Translator can be used without any specific OpenStack environment set up as python heat_translator.py --template-file== --template-type= --parameters="purpose=test" The heat_translator.py test program is at the root level of the project. The program has currently tested with TOSCA templates. -It requires two arguments:: - -1. Path to the file that needs to be translated. The file, flat yaml template or CSAR, can be specified as a local file in your +The only required argument is ``--template-file``. By default, the ``--template-type`` is set to ``tosca`` which is the only supported template type at present. +The value to the ``--template-file`` is a path to the file that needs to be translated. The file, flat yaml template or CSAR, can be specified as a local file in your system or via URL. -2. Type of translation (e.g. tosca) For example, a TOSCA hello world template can be translated by running the following command from the project location:: - python heat_translator.py --template-file=translator/tests/data/tosca_helloworld.yaml --template-type=tosca + python heat_translator.py --template-file=translator/tests/data/tosca_helloworld.yaml This should produce a translated Heat Orchestration Template on the command line. The translated content can be saved to a desired file by setting --output-file=. For example: :: diff --git a/translator/shell.py b/translator/shell.py index a11d66fd..1128ac0a 100644 --- a/translator/shell.py +++ b/translator/shell.py @@ -44,8 +44,8 @@ Test the heat-translator translation from command line as: --template-type= --parameters="purpose=test" Takes three user arguments, -1. type of translation (e.g. tosca) (required) -2. Path to the file that needs to be translated (required) +1. Path to the file that needs to be translated (required) +2. type of translation (e.g. tosca) (optional) 3. Input parameters (optional) In order to use heat-translator to only validate template,