Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
033b7b64
Commit
033b7b64
authored
17 years ago
by
Michael Hanselmann
Browse files
Options
Downloads
Patches
Plain Diff
Implement “cd /” and “cd” to get to the root directory.
Reviewed-by: iustinp
parent
38242904
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/cfgshell
+7
-1
7 additions, 1 deletion
tools/cfgshell
with
7 additions
and
1 deletion
tools/cfgshell
+
7
−
1
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment