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
e0d5ca1a
authored
Sep 05, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-vm-renewal-copy' into 'master'
Feature Vm Renewal Copy
parents
5bfe7a2d
6a0ff254
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
agent.py
+10
-4
misc/vm_renewal
+3
-0
No files found.
agent.py
View file @
e0d5ca1a
...
...
@@ -2,11 +2,19 @@
# -*- coding: utf-8 -*-
from
os
import
mkdir
,
environ
,
chdir
import
platform
from
shutil
import
copy
import
subprocess
import
sys
chdir
(
sys
.
path
[
0
])
subprocess
.
call
((
'pip'
,
'install'
,
'-r'
,
'requirements.txt'
))
try
:
chdir
(
sys
.
path
[
0
])
subprocess
.
call
((
'pip'
,
'install'
,
'-r'
,
'requirements.txt'
))
system
=
platform
.
system
()
if
system
==
'Linux'
:
copy
(
"/root/agent/misc/vm_renewal"
,
"/usr/local/bin/"
)
except
:
pass
# hope it works
from
twisted.internet
import
reactor
,
defer
...
...
@@ -16,7 +24,6 @@ from twisted.internet.serialport import SerialPort
import
uptime
import
logging
import
fileinput
import
platform
import
tarfile
from
os.path
import
expanduser
,
join
,
exists
from
glob
import
glob
...
...
@@ -48,7 +55,6 @@ mount_template_linux = (
',password=
%(password)
s,iocharset=utf8,uid=cloud 0 0
\n
'
)
system
=
platform
.
system
()
distros
=
{
'Scientific Linux'
:
'rhel'
,
'CentOS'
:
'rhel'
,
'CentOS Linux'
:
'rhel'
,
...
...
misc/vm_renewal
0 → 100755
View file @
e0d5ca1a
#!/bin/bash
sudo
bash
-c
"source /root/.virtualenvs/agent/bin/activate; source /root/.virtualenvs/agent/bin/postactivate 2>/dev/null; cd /root/agent; ./vm_renewal"
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