Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
agent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
7
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4bba2629
authored
Dec 16, 2014
by
Oliver Pinter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use absolute path in call()s
parent
cefb7c9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
freebsd/_freebsdcontext.py
+5
-8
freebsd/network.py
+1
-1
No files found.
freebsd/_freebsdcontext.py
View file @
4bba2629
...
@@ -12,9 +12,9 @@ working_directory = sys.path[0]
...
@@ -12,9 +12,9 @@ working_directory = sys.path[0]
try
:
try
:
# load virtio console driver, the device is /dev/ttyV0.1
# load virtio console driver, the device is /dev/ttyV0.1
subprocess
.
call
((
'kldload'
,
'-n'
,
'virtio_console'
))
subprocess
.
call
((
'
/sbin/
kldload'
,
'-n'
,
'virtio_console'
))
chdir
(
working_directory
)
chdir
(
working_directory
)
subprocess
.
call
((
'pip'
,
'install'
,
'-r'
,
'requirements.txt'
))
subprocess
.
call
((
'
/usr/local/bin/
pip'
,
'install'
,
'-r'
,
'requirements.txt'
))
copy
(
"/root/agent/misc/vm_renewal"
,
"/usr/local/bin/"
)
copy
(
"/root/agent/misc/vm_renewal"
,
"/usr/local/bin/"
)
except
:
except
:
pass
# hope it works
pass
# hope it works
...
@@ -90,7 +90,7 @@ class Context(BaseContext):
...
@@ -90,7 +90,7 @@ class Context(BaseContext):
@staticmethod
@staticmethod
def
restart_networking
():
def
restart_networking
():
subprocess
.
call
([
'/sbin/service'
,
'netif'
,
'restart'
])
subprocess
.
call
([
'/
usr/
sbin/service'
,
'netif'
,
'restart'
])
@staticmethod
@staticmethod
def
change_ip
(
interfaces
,
dns
):
def
change_ip
(
interfaces
,
dns
):
...
@@ -129,7 +129,7 @@ class Context(BaseContext):
...
@@ -129,7 +129,7 @@ class Context(BaseContext):
with
open
(
'/etc/fstab'
,
'a'
)
as
f
:
with
open
(
'/etc/fstab'
,
'a'
)
as
f
:
f
.
write
(
mount_template_linux
%
data
)
f
.
write
(
mount_template_linux
%
data
)
subprocess
.
call
(
'mount -a'
,
shell
=
True
)
subprocess
.
call
(
'
/sbin/
mount -a'
,
shell
=
True
)
@staticmethod
@staticmethod
def
get_keys
():
def
get_keys
():
...
@@ -197,10 +197,7 @@ class Context(BaseContext):
...
@@ -197,10 +197,7 @@ class Context(BaseContext):
@staticmethod
@staticmethod
def
start_access_server
():
def
start_access_server
():
try
:
subprocess
.
call
((
'/usr/sbin/service'
,
'ssh'
,
'start'
))
subprocess
.
call
((
'/sbin/start'
,
'ssh'
))
except
OSError
:
subprocess
.
call
((
'/bin/systemctl'
,
'start'
,
'sshd.service'
))
@staticmethod
@staticmethod
def
append
(
data
,
filename
,
chunk_number
,
uuid
):
def
append
(
data
,
filename
,
chunk_number
,
uuid
):
...
...
freebsd/network.py
View file @
4bba2629
...
@@ -88,7 +88,7 @@ def change_ip_freebsd(interfaces, dns):
...
@@ -88,7 +88,7 @@ def change_ip_freebsd(interfaces, dns):
'gw'
:
conf
[
'gw6'
if
ip
.
version
==
6
else
'gw4'
],
'gw'
:
conf
[
'gw6'
if
ip
.
version
==
6
else
'gw4'
],
'dns'
:
dns
})
'dns'
:
dns
})
for
ifname
,
conf
in
data
:
for
ifname
,
conf
in
data
:
subprocess
.
call
((
'/
sbin/ifup
'
,
ifname
))
subprocess
.
call
((
'/
usr/sbin/service'
,
'netif'
,
'start
'
,
ifname
))
# example:
# example:
...
...
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