Revision 625ac113 scripts/gnt-os
b/scripts/gnt-os | ||
---|---|---|
168 | 168 |
""" |
169 | 169 |
os = args[0] |
170 | 170 |
|
171 |
if opts.hvparams: |
|
172 |
os_hvp = {os: dict(opts.hvparams)} |
|
173 |
else: |
|
174 |
os_hvp = None |
|
175 |
|
|
176 |
if opts.osparams: |
|
177 |
osp = {os: opts.osparams} |
|
178 |
else: |
|
179 |
osp = None |
|
180 |
|
|
181 |
if not (os_hvp or osp): |
|
182 |
ToStderr("At least one of OS parameters or hypervisor parameters" |
|
183 |
" must be passed") |
|
184 |
return 1 |
|
185 |
|
|
171 | 186 |
op = opcodes.OpSetClusterParams(vg_name=None, |
172 | 187 |
enabled_hypervisors=None, |
173 | 188 |
hvparams=None, |
174 | 189 |
beparams=None, |
175 | 190 |
nicparams=None, |
176 | 191 |
candidate_pool_size=None, |
177 |
os_hvp={ |
|
178 |
os: dict(opts.hvparams) |
|
179 |
}) |
|
192 |
os_hvp=os_hvp, |
|
193 |
osparams=osp) |
|
180 | 194 |
SubmitOpCode(op) |
181 | 195 |
|
182 | 196 |
return 0 |
... | ... | |
184 | 198 |
|
185 | 199 |
commands = { |
186 | 200 |
'list': ( |
187 |
ListOS, ARGS_NONE, [NOHDR_OPT], "", "Lists all valid OSes on the master"), |
|
201 |
ListOS, ARGS_NONE, [NOHDR_OPT], "", "Lists all valid operating systems" |
|
202 |
" on the cluster"), |
|
188 | 203 |
'diagnose': ( |
189 |
DiagnoseOS, ARGS_NONE, [], "", "Diagnose all OSes"),
|
|
204 |
DiagnoseOS, ARGS_NONE, [], "", "Diagnose all operating systems"),
|
|
190 | 205 |
'modify': ( |
191 |
ModifyOS, ARGS_ONE_OS, [HVLIST_OPT], "", "Modify os parameters"), |
|
206 |
ModifyOS, ARGS_ONE_OS, [HVLIST_OPT, OSPARAMS_OPT], "", |
|
207 |
"Modify the OS parameters"), |
|
192 | 208 |
} |
193 | 209 |
|
194 | 210 |
if __name__ == '__main__': |
Also available in: Unified diff