Commit e0d5ca1a by Bach Dániel

Merge branch 'feature-vm-renewal-copy' into 'master'

Feature Vm Renewal Copy
parents 5bfe7a2d 6a0ff254
...@@ -2,11 +2,19 @@ ...@@ -2,11 +2,19 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from os import mkdir, environ, chdir from os import mkdir, environ, chdir
import platform
from shutil import copy
import subprocess import subprocess
import sys import sys
chdir(sys.path[0]) try:
subprocess.call(('pip', 'install', '-r', 'requirements.txt')) 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 from twisted.internet import reactor, defer
...@@ -16,7 +24,6 @@ from twisted.internet.serialport import SerialPort ...@@ -16,7 +24,6 @@ from twisted.internet.serialport import SerialPort
import uptime import uptime
import logging import logging
import fileinput import fileinput
import platform
import tarfile import tarfile
from os.path import expanduser, join, exists from os.path import expanduser, join, exists
from glob import glob from glob import glob
...@@ -48,7 +55,6 @@ mount_template_linux = ( ...@@ -48,7 +55,6 @@ mount_template_linux = (
',password=%(password)s,iocharset=utf8,uid=cloud 0 0\n') ',password=%(password)s,iocharset=utf8,uid=cloud 0 0\n')
system = platform.system()
distros = {'Scientific Linux': 'rhel', distros = {'Scientific Linux': 'rhel',
'CentOS': 'rhel', 'CentOS': 'rhel',
'CentOS Linux': 'rhel', 'CentOS Linux': 'rhel',
......
#!/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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment