Commit 01cb1ab2 by Czémán Arnold

Fix "Unhandles exception (_linux_set_time)" bug. Issue: #15

Plus correct flake8 errors.
parent 7f3d854d
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa ignore=E402
from os import environ, chdir
import platform
import subprocess
import sys
system = platform.system()
if system == "Linux":
......@@ -19,7 +21,6 @@ if system == "Linux":
from twisted.internet import reactor, defer
from twisted.internet.task import LoopingCall
import uptime
import logging
from inspect import getargspec, isfunction
......@@ -30,6 +31,7 @@ from utils import SerialLineReceiverBase
# (relative import error.
from context import BaseContext, get_context, get_serial # noqa
Context = get_context()
logging.basicConfig()
......
......@@ -8,8 +8,6 @@ from shutil import rmtree, move
import subprocess
import sys
working_directory = sys.path[0]
import logging
import fileinput
import tarfile
......@@ -19,13 +17,15 @@ from StringIO import StringIO
from base64 import decodestring
from hashlib import md5
from ssh import PubKey
from .network import change_ip_ubuntu, change_ip_rhel
from context import BaseContext
from twisted.internet import reactor
working_directory = sys.path[0]
logger = logging.getLogger()
SSH_DIR = expanduser('~cloud/.ssh')
......@@ -51,6 +51,7 @@ class Context(BaseContext):
# http://stackoverflow.com/questions/12081310/
# python-module-to-change-system-date-and-time
@staticmethod
def _linux_set_time(time):
import ctypes
import ctypes.util
......
......@@ -2,6 +2,8 @@ from base64 import decodestring
from struct import unpack
import binascii
import unittest
class InvalidKeyType(Exception):
pass
......@@ -56,9 +58,6 @@ class PubKey(object):
return u'<PubKey: %s>' % unicode(self)
import unittest
class SshTestCase(unittest.TestCase):
def setUp(self):
self.p1 = PubKey.from_str('ssh-rsa AAAAB3NzaC1yc2EA comment')
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
working_directory = r"C:\circle"
from os.path import join
import logging
......@@ -21,6 +19,8 @@ from .network import change_ip_windows
from context import BaseContext
working_directory = r"C:\circle"
logger = logging.getLogger()
......
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