Fix issues in naming and few other things
This commit is contained in:
		
					parent
					
						
							
								f919719b1e
							
						
					
				
			
			
				commit
				
					
						71279a968f
					
				
			
		
					 21 changed files with 274 additions and 281 deletions
				
			
		| 
						 | 
				
			
			@ -47,6 +47,6 @@ class VmUUIDField(Field):
 | 
			
		|||
        self.validation = self.vm_uuid_validation
 | 
			
		||||
 | 
			
		||||
    def vm_uuid_validation(self):
 | 
			
		||||
        r = etcd_client.get(os.path.join(config['api']['VM_PREFIX'], self.uuid))
 | 
			
		||||
        r = etcd_client.get(os.path.join(config['etcd']['vm_prefix'], self.uuid))
 | 
			
		||||
        if not r:
 | 
			
		||||
            self.add_error("VM with uuid {} does not exists".format(self.uuid))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,4 +13,4 @@ data = {
 | 
			
		|||
    "attributes": {"list": [], "key": [], "pool": "images"},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
etcd_client.put(os.path.join(config['api']['IMAGE_STORE_PREFIX'], uuid4().hex), json.dumps(data))
 | 
			
		||||
etcd_client.put(os.path.join(config['etcd']['image_store_prefix'], uuid4().hex), json.dumps(data))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ import binascii
 | 
			
		|||
import ipaddress
 | 
			
		||||
import random
 | 
			
		||||
import subprocess as sp
 | 
			
		||||
 | 
			
		||||
import logging
 | 
			
		||||
import requests
 | 
			
		||||
 | 
			
		||||
from pyotp import TOTP
 | 
			
		||||
| 
						 | 
				
			
			@ -10,23 +10,28 @@ from pyotp import TOTP
 | 
			
		|||
from ucloud.config import vm_pool, config
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
logger = logging.getLogger("ucloud.api.helper")
 | 
			
		||||
 | 
			
		||||
def check_otp(name, realm, token):
 | 
			
		||||
    try:
 | 
			
		||||
        data = {
 | 
			
		||||
            "auth_name": config['api']["AUTH_NAME"],
 | 
			
		||||
            "auth_token": TOTP(config['api']["AUTH_SEED"]).now(),
 | 
			
		||||
            "auth_realm": config['api']["AUTH_REALM"],
 | 
			
		||||
            "auth_name": config['otp']['auth_name'],
 | 
			
		||||
            "auth_token": TOTP(config['otp']['auth_seed']).now(),
 | 
			
		||||
            "auth_realm": config['otp']['auth_realm'],
 | 
			
		||||
            "name": name,
 | 
			
		||||
            "realm": realm,
 | 
			
		||||
            "token": token,
 | 
			
		||||
        }
 | 
			
		||||
    except binascii.Error:
 | 
			
		||||
    except binascii.Error as err:
 | 
			
		||||
        logger.error(
 | 
			
		||||
            "Cannot compute OTP for seed: {}".format(config['otp']['auth_seed'])
 | 
			
		||||
        )
 | 
			
		||||
        return 400
 | 
			
		||||
 | 
			
		||||
    response = requests.post(
 | 
			
		||||
        "{OTP_SERVER}{OTP_VERIFY_ENDPOINT}".format(
 | 
			
		||||
            OTP_SERVER=config['api']["OTP_SERVER"],
 | 
			
		||||
            OTP_VERIFY_ENDPOINT=config['api']["OTP_VERIFY_ENDPOINT"]
 | 
			
		||||
            OTP_SERVER=config['otp']['server'],
 | 
			
		||||
            OTP_VERIFY_ENDPOINT=config['otp']['verify_endpoint']
 | 
			
		||||
        ),
 | 
			
		||||
        json=data,
 | 
			
		||||
    )
 | 
			
		||||
| 
						 | 
				
			
			@ -80,7 +85,7 @@ def resolve_image_name(name, etcd_client):
 | 
			
		|||
    except Exception:
 | 
			
		||||
        raise ValueError("Image name not in correct format i.e {store_name}:{image_name}")
 | 
			
		||||
 | 
			
		||||
    images = etcd_client.get_prefix(config['api']['IMAGE_PREFIX'], value_in_json=True)
 | 
			
		||||
    images = etcd_client.get_prefix(config['etcd']['image_prefix'], value_in_json=True)
 | 
			
		||||
 | 
			
		||||
    # Try to find image with name == image_name and store_name == store_name
 | 
			
		||||
    try:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,7 +10,10 @@ from flask_restful import Resource, Api
 | 
			
		|||
from ucloud.common import counters
 | 
			
		||||
from ucloud.common.vm import VMStatus
 | 
			
		||||
from ucloud.common.request import RequestEntry, RequestType
 | 
			
		||||
from ucloud.config import (etcd_client, request_pool, vm_pool, host_pool, config, image_storage_handler)
 | 
			
		||||
from ucloud.config import (
 | 
			
		||||
    etcd_client, request_pool, vm_pool,
 | 
			
		||||
    host_pool, config, image_storage_handler
 | 
			
		||||
)
 | 
			
		||||
from . import schemas
 | 
			
		||||
from .helper import generate_mac, mac2ipv6
 | 
			
		||||
from . import logger
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +31,7 @@ class CreateVM(Resource):
 | 
			
		|||
        validator = schemas.CreateVMSchema(data)
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            vm_uuid = uuid4().hex
 | 
			
		||||
            vm_key = join_path(config['etcd']["VM_PREFIX"], vm_uuid)
 | 
			
		||||
            vm_key = join_path(config['etcd']['vm_prefix'], vm_uuid)
 | 
			
		||||
            specs = {
 | 
			
		||||
                "cpu": validator.specs["cpu"],
 | 
			
		||||
                "ram": validator.specs["ram"],
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +59,7 @@ class CreateVM(Resource):
 | 
			
		|||
            # Create ScheduleVM Request
 | 
			
		||||
            r = RequestEntry.from_scratch(
 | 
			
		||||
                type=RequestType.ScheduleVM, uuid=vm_uuid,
 | 
			
		||||
                request_prefix=config['etcd']["REQUEST_PREFIX"]
 | 
			
		||||
                request_prefix=config['etcd']['request_prefix']
 | 
			
		||||
            )
 | 
			
		||||
            request_pool.put(r)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -71,7 +74,7 @@ class VmStatus(Resource):
 | 
			
		|||
        validator = schemas.VMStatusSchema(data)
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            vm = vm_pool.get(
 | 
			
		||||
                join_path(config['etcd']["VM_PREFIX"], data["uuid"])
 | 
			
		||||
                join_path(config['etcd']['vm_prefix'], data["uuid"])
 | 
			
		||||
            )
 | 
			
		||||
            vm_value = vm.value.copy()
 | 
			
		||||
            vm_value["ip"] = []
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +82,7 @@ class VmStatus(Resource):
 | 
			
		|||
                network_name, mac, tap = network_mac_and_tap
 | 
			
		||||
                network = etcd_client.get(
 | 
			
		||||
                    join_path(
 | 
			
		||||
                        config['etcd']["NETWORK_PREFIX"],
 | 
			
		||||
                        config['etcd']['network_prefix'],
 | 
			
		||||
                        data["name"],
 | 
			
		||||
                        network_name,
 | 
			
		||||
                    ),
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +103,7 @@ class CreateImage(Resource):
 | 
			
		|||
        validator = schemas.CreateImageSchema(data)
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            file_entry = etcd_client.get(
 | 
			
		||||
                join_path(config['etcd']["FILE_PREFIX"], data["uuid"])
 | 
			
		||||
                join_path(config['etcd']['file_prefix'], data["uuid"])
 | 
			
		||||
            )
 | 
			
		||||
            file_entry_value = json.loads(file_entry.value)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -113,7 +116,7 @@ class CreateImage(Resource):
 | 
			
		|||
                "visibility": "public",
 | 
			
		||||
            }
 | 
			
		||||
            etcd_client.put(
 | 
			
		||||
                join_path(config['etcd']["IMAGE_PREFIX"], data["uuid"]),
 | 
			
		||||
                join_path(config['etcd']['image_prefix'], data["uuid"]),
 | 
			
		||||
                json.dumps(image_entry_json),
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -125,7 +128,7 @@ class ListPublicImages(Resource):
 | 
			
		|||
    @staticmethod
 | 
			
		||||
    def get():
 | 
			
		||||
        images = etcd_client.get_prefix(
 | 
			
		||||
            config['etcd']["IMAGE_PREFIX"], value_in_json=True
 | 
			
		||||
            config['etcd']['image_prefix'], value_in_json=True
 | 
			
		||||
        )
 | 
			
		||||
        r = {
 | 
			
		||||
            "images": []
 | 
			
		||||
| 
						 | 
				
			
			@ -148,7 +151,7 @@ class VMAction(Resource):
 | 
			
		|||
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            vm_entry = vm_pool.get(
 | 
			
		||||
                join_path(config['etcd']["VM_PREFIX"], data["uuid"])
 | 
			
		||||
                join_path(config['etcd']['vm_prefix'], data["uuid"])
 | 
			
		||||
            )
 | 
			
		||||
            action = data["action"]
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -172,7 +175,7 @@ class VMAction(Resource):
 | 
			
		|||
                type="{}VM".format(action.title()),
 | 
			
		||||
                uuid=data["uuid"],
 | 
			
		||||
                hostname=vm_entry.hostname,
 | 
			
		||||
                request_prefix=config['etcd']["REQUEST_PREFIX"]
 | 
			
		||||
                request_prefix=config['etcd']['request_prefix']
 | 
			
		||||
            )
 | 
			
		||||
            request_pool.put(r)
 | 
			
		||||
            return {"message": "VM {} Queued".format(action.title())}, 200
 | 
			
		||||
| 
						 | 
				
			
			@ -193,10 +196,10 @@ class VMMigration(Resource):
 | 
			
		|||
                type=RequestType.ScheduleVM,
 | 
			
		||||
                uuid=vm.uuid,
 | 
			
		||||
                destination=join_path(
 | 
			
		||||
                    config['etcd']["HOST_PREFIX"], validator.destination.value
 | 
			
		||||
                    config['etcd']['host_prefix'], validator.destination.value
 | 
			
		||||
                ),
 | 
			
		||||
                migration=True,
 | 
			
		||||
                request_prefix=config['etcd']["REQUEST_PREFIX"]
 | 
			
		||||
                request_prefix=config['etcd']['request_prefix']
 | 
			
		||||
            )
 | 
			
		||||
            request_pool.put(r)
 | 
			
		||||
            return {"message": "VM Migration Initialization Queued"}, 200
 | 
			
		||||
| 
						 | 
				
			
			@ -212,7 +215,7 @@ class ListUserVM(Resource):
 | 
			
		|||
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            vms = etcd_client.get_prefix(
 | 
			
		||||
                config['etcd']["VM_PREFIX"], value_in_json=True
 | 
			
		||||
                config['etcd']['vm_prefix'], value_in_json=True
 | 
			
		||||
            )
 | 
			
		||||
            return_vms = []
 | 
			
		||||
            user_vms = filter(lambda v: v.value["owner"] == data["name"], vms)
 | 
			
		||||
| 
						 | 
				
			
			@ -246,7 +249,7 @@ class ListUserFiles(Resource):
 | 
			
		|||
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            files = etcd_client.get_prefix(
 | 
			
		||||
                config['etcd']["FILE_PREFIX"], value_in_json=True
 | 
			
		||||
                config['etcd']['file_prefix'], value_in_json=True
 | 
			
		||||
            )
 | 
			
		||||
            return_files = []
 | 
			
		||||
            user_files = list(
 | 
			
		||||
| 
						 | 
				
			
			@ -270,7 +273,7 @@ class CreateHost(Resource):
 | 
			
		|||
        data = request.json
 | 
			
		||||
        validator = schemas.CreateHostSchema(data)
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            host_key = join_path(config['etcd']["HOST_PREFIX"], uuid4().hex)
 | 
			
		||||
            host_key = join_path(config['etcd']['host_prefix'], uuid4().hex)
 | 
			
		||||
            host_entry = {
 | 
			
		||||
                "specs": data["specs"],
 | 
			
		||||
                "hostname": data["hostname"],
 | 
			
		||||
| 
						 | 
				
			
			@ -309,7 +312,7 @@ class GetSSHKeys(Resource):
 | 
			
		|||
 | 
			
		||||
                # {user_prefix}/{realm}/{name}/key/
 | 
			
		||||
                etcd_key = join_path(
 | 
			
		||||
                    config['etcd']['USER_PREFIX'],
 | 
			
		||||
                    config['etcd']['user_prefix'],
 | 
			
		||||
                    data["realm"],
 | 
			
		||||
                    data["name"],
 | 
			
		||||
                    "key",
 | 
			
		||||
| 
						 | 
				
			
			@ -326,7 +329,7 @@ class GetSSHKeys(Resource):
 | 
			
		|||
 | 
			
		||||
                # {user_prefix}/{realm}/{name}/key/{key_name}
 | 
			
		||||
                etcd_key = join_path(
 | 
			
		||||
                    config['etcd']['USER_PREFIX'],
 | 
			
		||||
                    config['etcd']['user_prefix'],
 | 
			
		||||
                    data["realm"],
 | 
			
		||||
                    data["name"],
 | 
			
		||||
                    "key",
 | 
			
		||||
| 
						 | 
				
			
			@ -355,7 +358,7 @@ class AddSSHKey(Resource):
 | 
			
		|||
 | 
			
		||||
            # {user_prefix}/{realm}/{name}/key/{key_name}
 | 
			
		||||
            etcd_key = join_path(
 | 
			
		||||
                config['etcd']["USER_PREFIX"],
 | 
			
		||||
                config['etcd']['user_prefix'],
 | 
			
		||||
                data["realm"],
 | 
			
		||||
                data["name"],
 | 
			
		||||
                "key",
 | 
			
		||||
| 
						 | 
				
			
			@ -385,7 +388,7 @@ class RemoveSSHKey(Resource):
 | 
			
		|||
 | 
			
		||||
            # {user_prefix}/{realm}/{name}/key/{key_name}
 | 
			
		||||
            etcd_key = join_path(
 | 
			
		||||
                config['etcd']["USER_PREFIX"],
 | 
			
		||||
                config['etcd']['user_prefix'],
 | 
			
		||||
                data["realm"],
 | 
			
		||||
                data["name"],
 | 
			
		||||
                "key",
 | 
			
		||||
| 
						 | 
				
			
			@ -420,31 +423,35 @@ class CreateNetwork(Resource):
 | 
			
		|||
                "type": data["type"],
 | 
			
		||||
            }
 | 
			
		||||
            if validator.user.value:
 | 
			
		||||
                nb = pynetbox.api(
 | 
			
		||||
                    url=config['netbox']["NETBOX_URL"],
 | 
			
		||||
                    token=config['netbox']["NETBOX_TOKEN"],
 | 
			
		||||
                )
 | 
			
		||||
                nb_prefix = nb.ipam.prefixes.get(
 | 
			
		||||
                    prefix=config['network']["PREFIX"]
 | 
			
		||||
                )
 | 
			
		||||
 | 
			
		||||
                prefix = nb_prefix.available_prefixes.create(
 | 
			
		||||
                    data={
 | 
			
		||||
                        "prefix_length": config['network']["PREFIX_LENGTH"],
 | 
			
		||||
                        "description": '{}\'s network "{}"'.format(
 | 
			
		||||
                            data["name"], data["network_name"]
 | 
			
		||||
                        ),
 | 
			
		||||
                        "is_pool": True,
 | 
			
		||||
                    }
 | 
			
		||||
                )
 | 
			
		||||
                network_entry["ipv6"] = prefix["prefix"]
 | 
			
		||||
                try:
 | 
			
		||||
                    nb = pynetbox.api(
 | 
			
		||||
                        url=config['netbox']['url'],
 | 
			
		||||
                        token=config['netbox']['token'],
 | 
			
		||||
                    )
 | 
			
		||||
                    nb_prefix = nb.ipam.prefixes.get(
 | 
			
		||||
                        prefix=config['network']['prefix']
 | 
			
		||||
                    )
 | 
			
		||||
                    prefix = nb_prefix.available_prefixes.create(
 | 
			
		||||
                        data={
 | 
			
		||||
                            "prefix_length": int(config['network']['prefix_length']),
 | 
			
		||||
                            "description": '{}\'s network "{}"'.format(
 | 
			
		||||
                                data["name"], data["network_name"]
 | 
			
		||||
                            ),
 | 
			
		||||
                            "is_pool": True,
 | 
			
		||||
                        }
 | 
			
		||||
                    )
 | 
			
		||||
                except Exception:
 | 
			
		||||
                    logger.exception("Exception occur while contacting netbox")
 | 
			
		||||
                    return {"message": "Error occured while creating network."}
 | 
			
		||||
                else:
 | 
			
		||||
                    network_entry["ipv6"] = prefix["prefix"]
 | 
			
		||||
            else:
 | 
			
		||||
                network_entry["ipv6"] = "fd00::/64"
 | 
			
		||||
 | 
			
		||||
            network_key = join_path(
 | 
			
		||||
                config['network']["NETWORK_PREFIX"],
 | 
			
		||||
                data["name"],
 | 
			
		||||
                data["network_name"],
 | 
			
		||||
                config['etcd']['network_prefix'],
 | 
			
		||||
                data['name'],
 | 
			
		||||
                data['network_name'],
 | 
			
		||||
            )
 | 
			
		||||
            etcd_client.put(network_key, network_entry, value_in_json=True)
 | 
			
		||||
            return {"message": "Network successfully added."}
 | 
			
		||||
| 
						 | 
				
			
			@ -460,7 +467,7 @@ class ListUserNetwork(Resource):
 | 
			
		|||
 | 
			
		||||
        if validator.is_valid():
 | 
			
		||||
            prefix = join_path(
 | 
			
		||||
                config['network']["NETWORK_PREFIX"], data["name"]
 | 
			
		||||
                config['etcd']['network_prefix'], data["name"]
 | 
			
		||||
            )
 | 
			
		||||
            networks = etcd_client.get_prefix(prefix, value_in_json=True)
 | 
			
		||||
            user_networks = []
 | 
			
		||||
| 
						 | 
				
			
			@ -496,7 +503,7 @@ api.add_resource(CreateNetwork, "/network/create")
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    image_stores = list(etcd_client.get_prefix(config['etcd']['IMAGE_STORE_PREFIX'], value_in_json=True))
 | 
			
		||||
    image_stores = list(etcd_client.get_prefix(config['etcd']['image_store_prefix'], value_in_json=True))
 | 
			
		||||
    if len(image_stores) == 0:
 | 
			
		||||
        data = {
 | 
			
		||||
            "is_public": True,
 | 
			
		||||
| 
						 | 
				
			
			@ -506,7 +513,7 @@ def main():
 | 
			
		|||
            "attributes": {"list": [], "key": [], "pool": "images"},
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        etcd_client.put(join_path(config['etcd']['IMAGE_STORE_PREFIX'], uuid4().hex), json.dumps(data))
 | 
			
		||||
        etcd_client.put(join_path(config['etcd']['image_store_prefix'], uuid4().hex), json.dumps(data))
 | 
			
		||||
 | 
			
		||||
    app.run(host="::", debug=True)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ import bitmath
 | 
			
		|||
from ucloud.common.host import HostStatus
 | 
			
		||||
from ucloud.common.vm import VMStatus
 | 
			
		||||
from ucloud.config import etcd_client, config, vm_pool, host_pool
 | 
			
		||||
from . import helper
 | 
			
		||||
from . import helper, logger
 | 
			
		||||
from .common_fields import Field, VmUUIDField
 | 
			
		||||
from .helper import check_otp, resolve_vm_name
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -102,14 +102,14 @@ class CreateImageSchema(BaseSchema):
 | 
			
		|||
        super().__init__(data, fields)
 | 
			
		||||
 | 
			
		||||
    def file_uuid_validation(self):
 | 
			
		||||
        file_entry = etcd_client.get(os.path.join(config['etcd']['FILE_PREFIX'], self.uuid.value))
 | 
			
		||||
        file_entry = etcd_client.get(os.path.join(config['etcd']['file_prefix'], self.uuid.value))
 | 
			
		||||
        if file_entry is None:
 | 
			
		||||
            self.add_error(
 | 
			
		||||
                "Image File with uuid '{}' Not Found".format(self.uuid.value)
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
    def image_store_name_validation(self):
 | 
			
		||||
        image_stores = list(etcd_client.get_prefix(config['etcd']['IMAGE_STORE_PREFIX']))
 | 
			
		||||
        image_stores = list(etcd_client.get_prefix(config['etcd']['image_store_prefix']))
 | 
			
		||||
 | 
			
		||||
        image_store = next(
 | 
			
		||||
            filter(
 | 
			
		||||
| 
						 | 
				
			
			@ -220,6 +220,7 @@ class CreateVMSchema(OTPSchema):
 | 
			
		|||
        try:
 | 
			
		||||
            image_uuid = helper.resolve_image_name(self.image.value, etcd_client)
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            logger.exception("Cannot resolve image name = %s", self.image.value)
 | 
			
		||||
            self.add_error(str(e))
 | 
			
		||||
        else:
 | 
			
		||||
            self.image_uuid = image_uuid
 | 
			
		||||
| 
						 | 
				
			
			@ -235,7 +236,7 @@ class CreateVMSchema(OTPSchema):
 | 
			
		|||
 | 
			
		||||
        if _network:
 | 
			
		||||
            for net in _network:
 | 
			
		||||
                network = etcd_client.get(os.path.join(config['etcd']['NETWORK_PREFIX'],
 | 
			
		||||
                network = etcd_client.get(os.path.join(config['etcd']['network_prefix'],
 | 
			
		||||
                                                       self.name.value,
 | 
			
		||||
                                                       net), value_in_json=True)
 | 
			
		||||
                if not network:
 | 
			
		||||
| 
						 | 
				
			
			@ -400,7 +401,7 @@ class VmMigrationSchema(OTPSchema):
 | 
			
		|||
        if vm.status != VMStatus.running:
 | 
			
		||||
            self.add_error("Can't migrate non-running VM")
 | 
			
		||||
 | 
			
		||||
        if vm.hostname == os.path.join(config['etcd']['HOST_PREFIX'], self.destination.value):
 | 
			
		||||
        if vm.hostname == os.path.join(config['etcd']['host_prefix'], self.destination.value):
 | 
			
		||||
            self.add_error("Destination host couldn't be same as Source Host")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -442,7 +443,7 @@ class CreateNetwork(OTPSchema):
 | 
			
		|||
        super().__init__(data, fields=fields)
 | 
			
		||||
 | 
			
		||||
    def network_name_validation(self):
 | 
			
		||||
        network = etcd_client.get(os.path.join(config['etcd']['NETWORK_PREFIX'],
 | 
			
		||||
        network = etcd_client.get(os.path.join(config['etcd']['network_prefix'],
 | 
			
		||||
                                               self.name.value,
 | 
			
		||||
                                               self.network_name.value),
 | 
			
		||||
                                  value_in_json=True)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue