Browse Source

Update build settings and documentation

Pawan Singh Pal 4 months ago
parent
commit
c82debd18a

+ 2
- 0
MANIFEST.in View File

@@ -1,2 +1,4 @@
1 1
 recursive-include spyglass/utils/editor/static *
2 2
 recursive-include spyglass/utils/editor/templates *
3
+recursive-include spyglass/ **.yaml
4
+recursive-include spyglass/ **.json

+ 11
- 1
doc/source/getting_started.rst View File

@@ -187,7 +187,17 @@ spyglass -mg --type formation -f <URL> -u <user_id> -p <password> -d <site_confi
187 187
 spyglass -mg --type tugboat -x <Excel File> -e <Excel Spec> -d <Site Config> -s <Region> --template_dir=<j2 template dir>
188 188
 
189 189
 for example:
190
-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>
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
 
192 202
 Where sample 'excel_spec_upstream.yaml', 'SiteDesignSpec_v0.1.xlsx'
193 203
 'site_config.yaml' and J2 templates can be found under 'spyglass/examples'

+ 9
- 6
doc/source/tugboat.rst View File

@@ -85,13 +85,16 @@ Below is the definition for each key in the Excel spec
85 85
 
86 86
 Example: Tugboat Plugin Usage
87 87
 -----------------------------
88
+
88 89
 1. Required Input(Refer to 'spyglass/examples' folder to get these inputs)
89
-   a) Excel File: SiteDesignSpec_v0.1.xlsx
90
-   b) Excel Spec: excel_spec_upstream.yaml
91
-   c) Site Config: site_config.yaml
92
-   d) Template_dir: '../examples/templates'
93
-   e) Site name: airship-seaworthy
90
+
91
+    a) Excel File: SiteDesignSpec_v0.1.xlsx
92
+    b) Excel Spec: excel_spec_upstream.yaml
93
+    c) Site Config: site_config.yaml
94
+    d) Template_dir: '../examples/templates'
95
+    e) Site name: airship-seaworthy
94 96
 
95 97
 2. 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'

+ 4
- 4
doc/source/yaml-editor.rst View File

@@ -32,10 +32,10 @@ could not be fetched via :ref:`tugboatinfo` plugin.
32 32
 Yaml Editor Utility Inputs
33 33
 --------------------------
34 34
 
35
-a) Yaml File: Yaml file required to be edited (This is required field)
36
-b) Port: Port on which app shall be running
37
-c) Host: This is only used to form URL which can be followed to open file in browser
38
-d) String: String which is required to be updated in the file (default is '#CHANGE_ME')
35
+    a) Yaml File: Yaml file required to be edited (This is required field)
36
+    b) Port: Port on which app shall be running
37
+    c) Host: This is only used to form URL which can be followed to open file in browser
38
+    d) String: String which is required to be updated in the file (default is '#CHANGE_ME')
39 39
 
40 40
 Yaml Editor Utility Usage
41 41
 -------------------------

+ 1
- 1
setup.py View File

@@ -19,7 +19,7 @@ setup(
19 19
     name='spyglass',
20 20
     version='0.0.1',
21 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 23
     python_requires='>=3.5.0',
24 24
     license='Apache 2.0',
25 25
     packages=find_packages(),

+ 0
- 0
spyglass/data_extractor/plugins/tugboat/__init__.py View File


+ 8
- 7
spyglass/parser/engine.py View File

@@ -121,8 +121,8 @@ class ProcessDataSource():
121 121
             json_schema = json.load(f)
122 122
         try:
123 123
             # Suppressing writing of data2.json. Can use it for debugging
124
-            with open('data2.json', 'w') as outfile:
125
-                json.dump(temp_data, outfile, sort_keys=True, indent=4)
124
+            # with open('data2.json', 'w') as outfile:
125
+            #     json.dump(temp_data, outfile, sort_keys=True, indent=4)
126 126
             jsonschema.validate(json_data, json_schema)
127 127
         except jsonschema.exceptions.ValidationError as e:
128 128
             LOG.error("Validation Error")
@@ -336,11 +336,12 @@ class ProcessDataSource():
336 336
         self.data = extracted_data
337 337
         LOG.debug("Extracted data from plugin:\n{}".format(
338 338
             pprint.pformat(extracted_data)))
339
-        extracted_file = "extracted_file.yaml"
340
-        yaml_file = yaml.dump(extracted_data, default_flow_style=False)
341
-        with open(extracted_file, 'w') as f:
342
-            f.write(yaml_file)
343
-        f.close()
339
+        # Uncommeent following segment for debugging purpose.
340
+        # extracted_file = "extracted_file.yaml"
341
+        # yaml_file = yaml.dump(extracted_data, default_flow_style=False)
342
+        # with open(extracted_file, 'w') as f:
343
+        #     f.write(yaml_file)
344
+        # f.close()
344 345
 
345 346
         # Append region_data supplied from CLI to self.data
346 347
         self.data['region_name'] = self.region_name

Loading…
Cancel
Save