diff --git a/rally-jobs/nova.yaml b/rally-jobs/nova.yaml index d8ec54f666..d74ab83a30 100644 --- a/rally-jobs/nova.yaml +++ b/rally-jobs/nova.yaml @@ -656,7 +656,7 @@ size: 2 use_floatingip: true command: - script_file: "/home/jenkins/.rally/extra/instance_dd_test.sh" + script_file: "~/.rally/extra/instance_dd_test.sh" interpreter: "/bin/sh" username: "cirros" runner: @@ -679,7 +679,7 @@ name: {{image_name}} use_floatingip: false command: - script_file: "/home/jenkins/.rally/extra/instance_dd_test.sh" + script_file: "~/.rally/extra/instance_dd_test.sh" interpreter: "/bin/sh" username: "cirros" runner: diff --git a/rally-jobs/rally-mos.yaml b/rally-jobs/rally-mos.yaml index 7526117549..f173e144f4 100644 --- a/rally-jobs/rally-mos.yaml +++ b/rally-jobs/rally-mos.yaml @@ -296,7 +296,7 @@ floating_network: "net04_ext" use_floatingip: true command: - script_file: "/home/rally/.rally/extra/instance_dd_test.sh" + script_file: "~/.rally/extra/instance_dd_test.sh" interpreter: "/bin/sh" username: "cirros" runner: diff --git a/rally-jobs/rally-neutron.yaml b/rally-jobs/rally-neutron.yaml index 5f361aefbb..01bab0b23c 100644 --- a/rally-jobs/rally-neutron.yaml +++ b/rally-jobs/rally-neutron.yaml @@ -463,7 +463,7 @@ image: name: {{image_name}} command: - script_file: "/home/jenkins/.rally/extra/instance_dd_test.sh" + script_file: "~/.rally/extra/instance_dd_test.sh" interpreter: "/bin/sh" username: "cirros" runner: diff --git a/rally/task/validation.py b/rally/task/validation.py index a98f751f07..96003ba431 100644 --- a/rally/task/validation.py +++ b/rally/task/validation.py @@ -174,13 +174,13 @@ def check_command_dict(command): # due to template-driven configuration generation that can leave keys # defined but values empty. if command.get("interpreter"): - # An interpreter is given, check if exactly one way to specify - # script body is used: file or inline - if not (bool(command.get("script_file")) ^ - bool(command.get("script_inline"))): - raise ValueError( - "Exactly one of script_inline or script_file with interpreter" - " is expected: %r" % command) + script_file = command.get("script_file") + if script_file: + command["script_file"] = os.path.expanduser(script_file) + if "script_inline" in command: + raise ValueError( + "Exactly one of script_inline or script_file with " + "interpreter is expected: %r" % command) # User tries to upload a shell? Make sure it is same as interpreter interpreter = command.get("interpreter") interpreter = (interpreter[-1]