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]
try
:
# 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
)
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/"
)
except
:
pass
# hope it works
...
...
@@ -90,7 +90,7 @@ class Context(BaseContext):
@staticmethod
def
restart_networking
():
subprocess
.
call
([
'/sbin/service'
,
'netif'
,
'restart'
])
subprocess
.
call
([
'/
usr/
sbin/service'
,
'netif'
,
'restart'
])
@staticmethod
def
change_ip
(
interfaces
,
dns
):
...
...
@@ -129,7 +129,7 @@ class Context(BaseContext):
with
open
(
'/etc/fstab'
,
'a'
)
as
f
:
f
.
write
(
mount_template_linux
%
data
)
subprocess
.
call
(
'mount -a'
,
shell
=
True
)
subprocess
.
call
(
'
/sbin/
mount -a'
,
shell
=
True
)
@staticmethod
def
get_keys
():
...
...
@@ -197,10 +197,7 @@ class Context(BaseContext):
@staticmethod
def
start_access_server
():
try
:
subprocess
.
call
((
'/sbin/start'
,
'ssh'
))
except
OSError
:
subprocess
.
call
((
'/bin/systemctl'
,
'start'
,
'sshd.service'
))
subprocess
.
call
((
'/usr/sbin/service'
,
'ssh'
,
'start'
))
@staticmethod
def
append
(
data
,
filename
,
chunk_number
,
uuid
):
...
...
freebsd/network.py
View file @
4bba2629
...
...
@@ -88,7 +88,7 @@ def change_ip_freebsd(interfaces, dns):
'gw'
:
conf
[
'gw6'
if
ip
.
version
==
6
else
'gw4'
],
'dns'
:
dns
})
for
ifname
,
conf
in
data
:
subprocess
.
call
((
'/
sbin/ifup
'
,
ifname
))
subprocess
.
call
((
'/
usr/sbin/service'
,
'netif'
,
'start
'
,
ifname
))
# 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