Fix a bug in OSC related to URL handling

Fix a bug in OSC that prevents anything but local files to be
translated.

Change-Id: Ic49a3b30f2a1833dd962b3ecf45e490220e832f1
This commit is contained in:
Vahid Hashemian 2015-10-02 23:04:49 -07:00
parent e92bb4843f
commit 50b747d76a
1 changed files with 3 additions and 4 deletions

View File

@ -59,10 +59,6 @@ class TranslateTemplate(command.Command):
def take_action(self, parsed_args):
self.log.debug('take_action(%s)', parsed_args)
if not os.path.isfile(parsed_args.template_file):
sys.stdout.write('Could not find template file.')
raise SystemExit
if parsed_args.parameter:
parsed_params = parsed_args.parameter
else:
@ -76,6 +72,9 @@ class TranslateTemplate(command.Command):
tosca = ToscaTemplate(path, parsed_params, a_file)
translator = TOSCATranslator(tosca, parsed_params)
output = translator.translate()
else:
sys.stdout.write('Could not find template file.')
raise SystemExit
if parsed_args.output_file:
with open(parsed_args.output_file, 'w+') as f: