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
c70e6bc5
authored
May 29, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove garbage
parent
0c412496
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
27 deletions
+3
-27
agent.py
+0
-3
linux/_linuxcontext.py
+3
-17
windows/_win32context.py
+0
-7
No files found.
agent.py
View file @
c70e6bc5
...
@@ -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
...
...
linux/_linuxcontext.py
View file @
c70e6bc5
#!/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
):
...
...
windows/_win32context.py
View file @
c70e6bc5
#!/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
):
...
...
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