Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaohe Cao
slapos
Commits
2ae4505e
Commit
2ae4505e
authored
Apr 08, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recipe.shellinabox: Allow to pass knowledge0_cfg to get shell password from there
parent
75a8f28e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
slapos/recipe/shellinabox.py
slapos/recipe/shellinabox.py
+8
-2
No files found.
slapos/recipe/shellinabox.py
View file @
2ae4505e
...
@@ -29,12 +29,17 @@ import pwd
...
@@ -29,12 +29,17 @@ import pwd
import
grp
import
grp
import
os
import
os
import
shlex
import
shlex
import
ConfigParser
from
slapos.recipe.librecipe
import
GenericBaseRecipe
from
slapos.recipe.librecipe
import
GenericBaseRecipe
def
login_shell
(
args
):
def
login_shell
(
args
):
password
=
args
[
'password'
]
password
=
args
[
'password'
]
if
args
.
get
(
'knowledge0_cfg'
):
parser
=
ConfigParser
.
ConfigParser
()
parser
.
read
(
args
[
'knowledge0_cfg'
])
password
=
parser
.
get
(
'public'
,
'shell-password'
)
if
(
password
!=
''
):
if
(
password
!=
''
):
entered_password
=
getpass
()
entered_password
=
getpass
()
else
:
else
:
...
@@ -96,7 +101,8 @@ class Recipe(GenericBaseRecipe):
...
@@ -96,7 +101,8 @@ class Recipe(GenericBaseRecipe):
'%s.login_shell'
%
__name__
,
'%s.login_shell'
%
__name__
,
{
{
'password'
:
self
.
options
[
'password'
],
'password'
:
self
.
options
[
'password'
],
'shell'
:
self
.
options
[
'shell'
]
'shell'
:
self
.
options
[
'shell'
],
'knowledge0_cfg'
:
self
.
options
.
get
(
'knowledge0_cfg'
)
}
}
)
)
path_list
.
append
(
login_shell
)
path_list
.
append
(
login_shell
)
...
...
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