# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+
import pkg_resources
import logging
import subprocess
from yardstick.benchmark.scenarios import base
+
LOG = logging.getLogger(__name__)
cmd1 = "%s %s %s" % (self.parser_script, yangfile, toscafile)
cmd2 = "chmod 777 %s" % (self.parser_script)
subprocess.call(cmd2, shell=True)
- output = subprocess.call(cmd1, shell=True, stdout=subprocess.PIPE)
- print "yangtotosca finished"
+ p = subprocess.Popen(cmd1, shell=True, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ p.communicate()
+ LOG.info("yangtotosca finished")
- result['yangtotosca'] = "success" if output == 0 else "fail"
+ result['yangtotosca'] = "success" if p.returncode == 0 else "fail"
def teardown(self):
- ''' for scenario teardown remove parser and pyang '''
+ """ for scenario teardown remove parser and pyang """
self.teardown_script = pkg_resources.resource_filename(
"yardstick.benchmark.scenarios.parser",
Parser.TEARDOWN_SCRIPT)
def _test():
- '''internal test function'''
+ """internal test function"""
pass
+
if __name__ == '__main__':
_test()