Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
jijisa
/
porch
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7b698eb4
authored
Mar 24, 2017
by
Heechul Kim
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ssh pub/pri key pair creation is not needed so commented out.
parent
31c9e5a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
porch/api/machine/bizlogic.py
porch/api/machine/bizlogic.py
View file @
7b698eb4
...
@@ -165,6 +165,7 @@ def provision_machine(name):
...
@@ -165,6 +165,7 @@ def provision_machine(name):
return
(
False
,
s_msg
)
return
(
False
,
s_msg
)
# Create ssh private/public keys
# Create ssh private/public keys
"""
key = rsa.generate_private_key(backend=default_backend(),
\
key = rsa.generate_private_key(backend=default_backend(),
\
public_exponent=65537, key_size=2048)
public_exponent=65537, key_size=2048)
pubkey = key.public_key().public_bytes(serialization.Encoding.OpenSSH,
\
pubkey = key.public_key().public_bytes(serialization.Encoding.OpenSSH,
\
...
@@ -194,6 +195,7 @@ def provision_machine(name):
...
@@ -194,6 +195,7 @@ def provision_machine(name):
except:
except:
s_msg = 'Fail to create ssh public key.'
s_msg = 'Fail to create ssh public key.'
return (False, s_msg)
return (False, s_msg)
"""
# Create fai config tar file on TFTP_FAI_DIR
# Create fai config tar file on TFTP_FAI_DIR
# copy base tar file to d['name'].tar
# copy base tar file to d['name'].tar
...
@@ -207,7 +209,7 @@ def provision_machine(name):
...
@@ -207,7 +209,7 @@ def provision_machine(name):
# add pubkeys/<ip> into tarfile.
# add pubkeys/<ip> into tarfile.
with
tarfile
.
open
(
s_dst
,
'a'
)
as
o_tar
:
with
tarfile
.
open
(
s_dst
,
'a'
)
as
o_tar
:
o_tar
.
add
(
s_pubkey_file
,
arcname
=
'pubkeys/{}'
.
format
(
d
[
'ip'
]))
#
o_tar.add(s_pubkey_file, arcname='pubkeys/{}'.format(d['ip']))
if
svc_iface_file
:
if
svc_iface_file
:
o_tar
.
add
(
svc_iface_file
,
arcname
=
'svc-interface'
)
o_tar
.
add
(
svc_iface_file
,
arcname
=
'svc-interface'
)
...
...
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