Commit c70e6bc5 by Bach Dániel

remove garbage

parent 0c412496
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
from os import environ, chdir from os import environ, chdir
import platform import platform
from shutil import copy
import subprocess import subprocess
import sys import sys
...@@ -13,8 +12,6 @@ if system == "Linux": ...@@ -13,8 +12,6 @@ if system == "Linux":
try: try:
chdir(sys.path[0]) chdir(sys.path[0])
subprocess.call(('pip', 'install', '-r', 'requirements.txt')) subprocess.call(('pip', 'install', '-r', 'requirements.txt'))
if system == 'Linux':
copy("/root/agent/misc/vm_renewal", "/usr/local/bin/")
except: except:
pass # hope it works pass # hope it works
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from os import mkdir, environ, chdir from os import mkdir
import platform import platform
from shutil import copy, rmtree, move from shutil import rmtree, move
import subprocess import subprocess
import sys import sys
system = platform.system()
working_directory = sys.path[0] working_directory = sys.path[0]
try:
chdir(working_directory)
subprocess.call(('pip', 'install', '-r', 'requirements.txt'))
if system == 'Linux':
copy("/root/agent/misc/vm_renewal", "/usr/local/bin/")
except:
pass # hope it works
import logging import logging
import fileinput import fileinput
import tarfile import tarfile
...@@ -35,10 +25,7 @@ from context import BaseContext ...@@ -35,10 +25,7 @@ from context import BaseContext
from twisted.internet import reactor from twisted.internet import reactor
logging.basicConfig()
logger = logging.getLogger() logger = logging.getLogger()
level = environ.get('LOGLEVEL', 'INFO')
logger.setLevel(level)
SSH_DIR = expanduser('~cloud/.ssh') SSH_DIR = expanduser('~cloud/.ssh')
AUTHORIZED_KEYS = join(SSH_DIR, 'authorized_keys') AUTHORIZED_KEYS = join(SSH_DIR, 'authorized_keys')
...@@ -55,8 +42,7 @@ distros = {'Scientific Linux': 'rhel', ...@@ -55,8 +42,7 @@ distros = {'Scientific Linux': 'rhel',
'CentOS Linux': 'rhel', 'CentOS Linux': 'rhel',
'Debian': 'debian', 'Debian': 'debian',
'Ubuntu': 'debian'} 'Ubuntu': 'debian'}
if system == 'Linux': distro = distros[platform.linux_distribution()[0]]
distro = distros[platform.linux_distribution()[0]]
class Context(BaseContext): class Context(BaseContext):
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import platform
system = platform.system()
working_directory = r"C:\circle" working_directory = r"C:\circle"
from os import environ
from os.path import join from os.path import join
import logging import logging
...@@ -25,10 +21,7 @@ from .network import change_ip_windows ...@@ -25,10 +21,7 @@ from .network import change_ip_windows
from context import BaseContext from context import BaseContext
logging.basicConfig()
logger = logging.getLogger() logger = logging.getLogger()
level = environ.get('LOGLEVEL', 'INFO')
logger.setLevel(level)
class Context(BaseContext): class Context(BaseContext):
......
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