diff --git a/SWSCloudNode/qemu/__init__.py b/SWSCloudNode/qemu/__init__.py index 7060576..2a124d0 100644 --- a/SWSCloudNode/qemu/__init__.py +++ b/SWSCloudNode/qemu/__init__.py @@ -163,7 +163,8 @@ class QEMU: f.close() return True - def create(self, cores, memory, storage, swap, hostname, ipv4, dns1, dns2, password, os_name, os_suite, ssh_key=None): + def create(self, cores, memory, storage, swap, hostname, ipv4, ipv4_gateway, dns1, dns2, + password, os_name, os_suite, interface, ssh_key=None): """ функция создания виртуальной машины """ @@ -180,10 +181,6 @@ class QEMU: # TODO: move to settings file mirror = "http://ru.archive.ubuntu.com/ubuntu/" - # TODO: move to settings file - gw = "192.168.1.254" - # TODO: move to settings file - interface = 'br0' c = [ "cd", @@ -198,7 +195,7 @@ class QEMU: "-o", "--libvirt=qemu:///system", "--ip=%s" % ipv4, - "--gw=%s" % gw, + "--gw=%s" % ipv4_gateway, # PARTITIONING # "--part=/var/lib/qemu/images/%s/partition" % values['hostname'], "--rootsize=%s" % storage, diff --git a/cloud_node_agent.py b/cloud_node_agent.py index d79862b..cc55ac6 100644 --- a/cloud_node_agent.py +++ b/cloud_node_agent.py @@ -137,8 +137,8 @@ while True: try: qemu.QEMU().create( p['cores'], p['memory'], p['storage'], p['swap'], p['hostname'], - p['ipv4'], p['dns1'], p['dns2'], p['password'], - p['os_name'], p['os_suite'], p['ssh_key'] + p['ipv4'], p['ipv4_gateway'], p['dns1'], p['dns2'], p['password'], + p['os_name'], p['os_suite'], settings.get('node', 'interface'), p['ssh_key'] ) except Exception as e: logging.warning(e) diff --git a/setup.py b/setup.py index 72066ee..9879ec3 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name='SWSCloudNode', - version='3.0.1-beta', + version='3.0.1-beta2', author='Vyacheslav Anzhiganov', author_email='vanzhiganov@ya.ru', packages=[