summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhemanthnakkina <mail2hemanth.n@gmail.com>2018-11-29 23:32:45 +0530
committerGitHub <noreply@github.com>2018-11-29 23:32:45 +0530
commite6585e48af01b14caf13db714887f595c32b55d5 (patch)
tree416bca9e3395623d2faadd22c1626fa84fb15df4
parenta2eedb63702ae473b7c5ab57e7615a1d0684e0c5 (diff)
parentc82debd18ab02a8049dc6f9735cfa1d380750ba2 (diff)
Merge pull request #7 from pawansingh126/master
Update build settings and documentation
-rw-r--r--MANIFEST.in2
-rw-r--r--doc/source/getting_started.rst12
-rw-r--r--doc/source/tugboat.rst15
-rw-r--r--doc/source/yaml-editor.rst8
-rw-r--r--setup.py2
-rw-r--r--spyglass/data_extractor/plugins/tugboat/__init__.py0
-rw-r--r--spyglass/parser/engine.py15
7 files changed, 35 insertions, 19 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index d90a4e1..e00b83e 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,2 +1,4 @@
1recursive-include spyglass/utils/editor/static * 1recursive-include spyglass/utils/editor/static *
2recursive-include spyglass/utils/editor/templates * 2recursive-include spyglass/utils/editor/templates *
3recursive-include spyglass/ **.yaml
4recursive-include spyglass/ **.json
diff --git a/doc/source/getting_started.rst b/doc/source/getting_started.rst
index fec8cc6..d8d52ba 100644
--- a/doc/source/getting_started.rst
+++ b/doc/source/getting_started.rst
@@ -187,7 +187,17 @@ spyglass -mg --type formation -f <URL> -u <user_id> -p <password> -d <site_confi
187spyglass -mg --type tugboat -x <Excel File> -e <Excel Spec> -d <Site Config> -s <Region> --template_dir=<j2 template dir> 187spyglass -mg --type tugboat -x <Excel File> -e <Excel Spec> -d <Site Config> -s <Region> --template_dir=<j2 template dir>
188 188
189for example: 189for example:
190spyglass -mg -t tugboat -x SiteDesignSpec_v1.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<j2 template dir> 190 2.1 Generating intermediary and manifests
191 spyglass -mg -t tugboat -x SiteDesignSpec_v1.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<j2 template dir>
192
193 2.2 Generating intermediary without manifests
194 spyglass -g -t tugboat -x SiteDesignSpec_v1.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy
195
196 2.3 Generating manifests without intermediary
197 spyglass -m -t tugboat -x SiteDesignSpec_v1.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<j2 template dir>
198
199 2.4 Generating manifests using intermediary
200 spyglass -mi <intermediary.yaml> --template_dir=<j2 template dir>
191 201
192Where sample 'excel_spec_upstream.yaml', 'SiteDesignSpec_v0.1.xlsx' 202Where sample 'excel_spec_upstream.yaml', 'SiteDesignSpec_v0.1.xlsx'
193'site_config.yaml' and J2 templates can be found under 'spyglass/examples' 203'site_config.yaml' and J2 templates can be found under 'spyglass/examples'
diff --git a/doc/source/tugboat.rst b/doc/source/tugboat.rst
index 9851149..c17508d 100644
--- a/doc/source/tugboat.rst
+++ b/doc/source/tugboat.rst
@@ -85,13 +85,16 @@ Below is the definition for each key in the Excel spec
85 85
86Example: Tugboat Plugin Usage 86Example: Tugboat Plugin Usage
87----------------------------- 87-----------------------------
88
881. Required Input(Refer to 'spyglass/examples' folder to get these inputs) 891. Required Input(Refer to 'spyglass/examples' folder to get these inputs)
89 a) Excel File: SiteDesignSpec_v0.1.xlsx 90
90 b) Excel Spec: excel_spec_upstream.yaml 91 a) Excel File: SiteDesignSpec_v0.1.xlsx
91 c) Site Config: site_config.yaml 92 b) Excel Spec: excel_spec_upstream.yaml
92 d) Template_dir: '../examples/templates' 93 c) Site Config: site_config.yaml
93 e) Site name: airship-seaworthy 94 d) Template_dir: '../examples/templates'
95 e) Site name: airship-seaworthy
94 96
952. Spyglass CLI Command: 972. Spyglass CLI Command:
96 spyglass -mg -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates' 98::
97 99
100 spyglass -mg -t tugboat -x SiteDesignSpec_v0.1.xlsx -e excel_spec_upstream.yaml -d site_config.yaml -s airship-seaworthy --template_dir=<relative path to '../examples/templates'
diff --git a/doc/source/yaml-editor.rst b/doc/source/yaml-editor.rst
index 56b9ec5..7e5a246 100644
--- a/doc/source/yaml-editor.rst
+++ b/doc/source/yaml-editor.rst
@@ -32,10 +32,10 @@ could not be fetched via :ref:`tugboatinfo` plugin.
32Yaml Editor Utility Inputs 32Yaml Editor Utility Inputs
33-------------------------- 33--------------------------
34 34
35a) Yaml File: Yaml file required to be edited (This is required field) 35 a) Yaml File: Yaml file required to be edited (This is required field)
36b) Port: Port on which app shall be running 36 b) Port: Port on which app shall be running
37c) Host: This is only used to form URL which can be followed to open file in browser 37 c) Host: This is only used to form URL which can be followed to open file in browser
38d) String: String which is required to be updated in the file (default is '#CHANGE_ME') 38 d) String: String which is required to be updated in the file (default is '#CHANGE_ME')
39 39
40Yaml Editor Utility Usage 40Yaml Editor Utility Usage
41------------------------- 41-------------------------
diff --git a/setup.py b/setup.py
index c022d7b..6cbf558 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ setup(
19 name='spyglass', 19 name='spyglass',
20 version='0.0.1', 20 version='0.0.1',
21 description='Generate Airship specific yaml manifests from data sources', 21 description='Generate Airship specific yaml manifests from data sources',
22 url='http://github.com/att-comdev/tugboat', 22 url='http://github.com/att-comdev/spyglass',
23 python_requires='>=3.5.0', 23 python_requires='>=3.5.0',
24 license='Apache 2.0', 24 license='Apache 2.0',
25 packages=find_packages(), 25 packages=find_packages(),
diff --git a/spyglass/data_extractor/plugins/tugboat/__init__.py b/spyglass/data_extractor/plugins/tugboat/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/spyglass/data_extractor/plugins/tugboat/__init__.py
diff --git a/spyglass/parser/engine.py b/spyglass/parser/engine.py
index 27b2b05..6e92a89 100644
--- a/spyglass/parser/engine.py
+++ b/spyglass/parser/engine.py
@@ -121,8 +121,8 @@ class ProcessDataSource():
121 json_schema = json.load(f) 121 json_schema = json.load(f)
122 try: 122 try:
123 # Suppressing writing of data2.json. Can use it for debugging 123 # Suppressing writing of data2.json. Can use it for debugging
124 with open('data2.json', 'w') as outfile: 124 # with open('data2.json', 'w') as outfile:
125 json.dump(temp_data, outfile, sort_keys=True, indent=4) 125 # json.dump(temp_data, outfile, sort_keys=True, indent=4)
126 jsonschema.validate(json_data, json_schema) 126 jsonschema.validate(json_data, json_schema)
127 except jsonschema.exceptions.ValidationError as e: 127 except jsonschema.exceptions.ValidationError as e:
128 LOG.error("Validation Error") 128 LOG.error("Validation Error")
@@ -336,11 +336,12 @@ class ProcessDataSource():
336 self.data = extracted_data 336 self.data = extracted_data
337 LOG.debug("Extracted data from plugin:\n{}".format( 337 LOG.debug("Extracted data from plugin:\n{}".format(
338 pprint.pformat(extracted_data))) 338 pprint.pformat(extracted_data)))
339 extracted_file = "extracted_file.yaml" 339 # Uncommeent following segment for debugging purpose.
340 yaml_file = yaml.dump(extracted_data, default_flow_style=False) 340 # extracted_file = "extracted_file.yaml"
341 with open(extracted_file, 'w') as f: 341 # yaml_file = yaml.dump(extracted_data, default_flow_style=False)
342 f.write(yaml_file) 342 # with open(extracted_file, 'w') as f:
343 f.close() 343 # f.write(yaml_file)
344 # f.close()
344 345
345 # Append region_data supplied from CLI to self.data 346 # Append region_data supplied from CLI to self.data
346 self.data['region_name'] = self.region_name 347 self.data['region_name'] = self.region_name