Added --conf-dir, --etcd-{host,port,ca_cert,cert_cert,cert_key} parameters to cli and settings is now accessbile through uncloud.shared.shared.settings
This commit is contained in:
parent
e6d22a73c5
commit
c3b42aabc6
19 changed files with 176 additions and 154 deletions
|
|
@ -17,7 +17,6 @@ from uncloud.common.network import create_dev, delete_network_interface
|
|||
from uncloud.common.schemas import VMSchema, NetworkSchema
|
||||
from uncloud.host import logger
|
||||
from uncloud.common.shared import shared
|
||||
from uncloud.common.settings import settings
|
||||
from uncloud.vmm import VMM
|
||||
|
||||
from marshmallow import ValidationError
|
||||
|
|
@ -91,7 +90,7 @@ class VM:
|
|||
self.vmm.socket_dir, self.uuid
|
||||
),
|
||||
destination_host_key=destination_host_key, # Where source host transfer VM
|
||||
request_prefix=settings["etcd"]["request_prefix"],
|
||||
request_prefix=shared.settings["etcd"]["request_prefix"],
|
||||
)
|
||||
shared.request_pool.put(r)
|
||||
else:
|
||||
|
|
@ -119,7 +118,7 @@ class VM:
|
|||
network_name, mac, tap = network_mac_and_tap
|
||||
|
||||
_key = os.path.join(
|
||||
settings["etcd"]["network_prefix"],
|
||||
shared.settings["etcd"]["network_prefix"],
|
||||
self.vm["owner"],
|
||||
network_name,
|
||||
)
|
||||
|
|
@ -133,13 +132,13 @@ class VM:
|
|||
if network["type"] == "vxlan":
|
||||
tap = create_vxlan_br_tap(
|
||||
_id=network["id"],
|
||||
_dev=settings["network"]["vxlan_phy_dev"],
|
||||
_dev=shared.settings["network"]["vxlan_phy_dev"],
|
||||
tap_id=tap,
|
||||
ip=network["ipv6"],
|
||||
)
|
||||
|
||||
all_networks = shared.etcd_client.get_prefix(
|
||||
settings["etcd"]["network_prefix"],
|
||||
shared.settings["etcd"]["network_prefix"],
|
||||
value_in_json=True,
|
||||
)
|
||||
|
||||
|
|
@ -229,7 +228,7 @@ class VM:
|
|||
def resolve_network(network_name, network_owner):
|
||||
network = shared.etcd_client.get(
|
||||
join_path(
|
||||
settings["etcd"]["network_prefix"],
|
||||
shared.settings["etcd"]["network_prefix"],
|
||||
network_owner,
|
||||
network_name,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue