Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
033b7b64
Commit
033b7b64
authored
Jul 25, 2007
by
Michael Hanselmann
Browse files
Implement “cd /” and “cd” to get to the root directory.
Reviewed-by: iustinp
parent
38242904
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/cfgshell
View file @
033b7b64
...
...
@@ -186,7 +186,8 @@ class ConfigShell(cmd.Cmd):
def
do_cd
(
self
,
line
):
"""Changes the current path.
Valid arguments: either .. or a child of the current object.
Valid arguments: either .., /, "" (no argument) or a child of the current
object.
"""
if
line
==
".."
:
...
...
@@ -197,6 +198,10 @@ class ConfigShell(cmd.Cmd):
else
:
print
"Already at top level"
return
False
elif
len
(
line
)
==
0
or
line
==
"/"
:
self
.
parents
=
self
.
parents
[
0
:
1
]
self
.
path
=
[]
return
False
pointer
=
self
.
parents
[
-
1
]
dirs
,
entries
=
self
.
_get_entries
(
pointer
)
...
...
@@ -317,6 +322,7 @@ class ConfigShell(cmd.Cmd):
print
return
True
class
Error
(
Exception
):
"""Generic exception"""
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment