Conditions | 8 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import pipes |
||
12 | def build_command(self, version=None, pre_release=False, |
||
13 | download_path=None): |
||
14 | command = "curl -sL %s | sudo bash" % (pipes.quote(self.OMNITRUCK)) |
||
15 | |||
16 | command_args = [] |
||
17 | |||
18 | if pre_release or version or download_path: |
||
19 | command_args += ['-s', '--'] |
||
20 | |||
21 | if pre_release: |
||
22 | command_args += ['-p'] |
||
23 | |||
24 | if version: |
||
25 | command_args += ['-v', version] |
||
26 | |||
27 | if download_path: |
||
28 | command_args += ['-v', download_path] |
||
29 | |||
30 | command_args = [pipes.quote(arg) for arg in command_args] |
||
31 | command_args = ' '.join(command_args) |
||
32 | command = command + ' ' + command_args |
||
33 | |||
34 | return command |
||
35 | |||
51 |