CORD-2247: Change XOSGenerator to XOSProcessor in accordance with latest
changes to xproto
Change-Id: I284b4e75ab779b9c4dd6a2b06d2fcf413bccb6e6
diff --git a/src/tosca/generator.py b/src/tosca/generator.py
index 6aa309c..6d82150 100644
--- a/src/tosca/generator.py
+++ b/src/tosca/generator.py
@@ -16,7 +16,7 @@
import os
from default import TOSCA_DEFS_DIR, TOSCA_KEYS_DIR
-from xosgenx.generator import XOSGenerator
+from xosgenx.generator import XOSProcessor
from xosapi.xos_grpc_client import Empty
class Args:
@@ -43,7 +43,7 @@
args.inputs = str(xproto.xproto)
args.target = os.path.join(current_dir, 'xtarget/tosca.xtarget')
args.write_to_file = 'target'
- XOSGenerator.generate(args)
+ XOSProcessor.process(args)
print "[XOS-TOSCA] Recipes generated in %s" % args.output
except Exception as e:
print "[XOS-TOSCA] Failed to generate TOSCA"
@@ -57,7 +57,7 @@
args.target = os.path.join(current_dir, 'xtarget/tosca_keys.xtarget')
args.write_to_file = 'single'
args.dest_file = 'KEYS.py'
- XOSGenerator.generate(args)
+ XOSProcessor.process(args)
print "[XOS-TOSCA] TOSCA Keys generated in %s" % args.output
except Exception as e:
print "[XOS-TOSCA] Failed to generate TOSCA Keys"
diff --git a/test/test_tosca_generator.py b/test/test_tosca_generator.py
index 0011d31..1d560d2 100644
--- a/test/test_tosca_generator.py
+++ b/test/test_tosca_generator.py
@@ -16,7 +16,7 @@
import unittest
import os
-from xosgenx.generator import XOSGenerator
+from xosgenx.generator import XOSProcessor
current_dir = os.path.dirname(os.path.realpath(__file__))
OUTPUT_DIR = os.path.join(current_dir, 'out');
@@ -49,7 +49,7 @@
args.write_to_file = "single"
args.dest_file = "basic.yaml"
args.quiet = False
- output = XOSGenerator.generate(args)
+ output = XOSProcessor.process(args)
self.assertIn("name:", output)
self.assertIn("files:", output)
@@ -77,9 +77,9 @@
args.output = OUTPUT_DIR
args.write_to_file = 'target'
args.quiet = False
- output = XOSGenerator.generate(args)
+ output = XOSProcessor.process(args)
self.assertEqual(output.count("name:"), 4)
self.assertIn("prop:", output)
if __name__ == '__main__':
- unittest.main()
\ No newline at end of file
+ unittest.main()