Revision dad1e806
b/scripts/gnt-instance | ||
---|---|---|
154 | 154 |
return choice |
155 | 155 |
|
156 | 156 |
|
157 |
def _TransformPath(user_input): |
|
158 |
"""Transform a user path into a canonical value. |
|
159 |
|
|
160 |
This function transforms the a path passed as textual information |
|
161 |
into the constants that the LU code expects. |
|
162 |
|
|
163 |
""" |
|
164 |
if user_input: |
|
165 |
if user_input.lower() == "default": |
|
166 |
result_path = constants.VALUE_DEFAULT |
|
167 |
elif user_input.lower() == "none": |
|
168 |
result_path = constants.VALUE_NONE |
|
169 |
else: |
|
170 |
if not os.path.isabs(user_input): |
|
171 |
raise errors.OpPrereqError("Path '%s' is not an absolute filename" % |
|
172 |
user_input) |
|
173 |
result_path = user_input |
|
174 |
else: |
|
175 |
result_path = constants.VALUE_DEFAULT |
|
176 |
|
|
177 |
return result_path |
|
178 |
|
|
179 |
|
|
180 | 157 |
def _EnsureInstancesExist(client, names): |
181 | 158 |
"""Check for and ensure the given instance names exist. |
182 | 159 |
|
Also available in: Unified diff