Commit b5b64fa0 by Guba Sándor

fix windows names

parent ee753180
import platform
from os.path import exists
""" This is the defautl context file. It replaces the Context class
to the platform specific one.
"""
import platform
from os.path import exists
from sys import path
# Add current directory to the import path
def _get_virtio_device():
......@@ -26,7 +27,7 @@ def _get_virtio_device():
def get_context():
system = platform.system()
if system == "Windows":
from win32._win32context import Context
from windows._win32context import Context
elif system == "Linux":
from linux._linuxcontext import Context
else:
......@@ -40,7 +41,7 @@ def get_serial():
if system == 'Windows':
port = _get_virtio_device()
if port:
from win32.win32virtio import SerialPort
from windows.win32virtio import SerialPort
else:
from twisted.internet.serial import SerialPort
import pythoncom
......
import _win32context
import win32virtio
import network
\ No newline at end of file
......@@ -4,9 +4,10 @@
import platform
system = platform.system()
working_directory = "C:/agent"
working_directory = r"C:\circle"
from os import environ, join
from os import environ
from os.path import join
import logging
import tarfile
......@@ -97,7 +98,7 @@ class Context(BaseContext):
myfile.write(data)
@staticmethod
def _update_registry(cls, dir, executable):
def _update_registry(dir, executable):
# HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\circle-agent
from _winreg import (OpenKeyEx, SetValueEx, QueryValueEx,
HKEY_LOCAL_MACHINE, KEY_ALL_ACCESS)
......
......@@ -26,7 +26,7 @@ def get_interfaces_windows(interfaces):
yield nic, conf
def change_ip(interfaces, dns):
def change_ip_windows(interfaces, dns):
for nic, conf in get_interfaces_windows(interfaces):
link_local = IPNetwork('fe80::/16')
new_addrs = [IPNetwork(ip) for ip in conf['addresses']]
......
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