# Path: networking_vsphere/_i18n.py
# DOMAIN = "networking_vsphere"
# _C = _translators.contextual_form
# _P = _translators.plural_form
# _LI = _translators.log_info
# _LW = _translators.log_warning
# _LE = _translators.log_error
# _LC = _translators.log_critical
# def get_available_languages():
# 
# Path: networking_vsphere/common/constants.py
# AGENT_TYPE_OVSVAPP = "OVSvApp Agent"
# AGENT_TYPE_DVS = 'DVS agent'
# OVSVAPP = 'ovsvapp'
# DVS = 'dvs'
# OVSVAPP_PLUGIN = 'ovsvapp_service_plugin'
# DEVICE = 'device'
# VMWARE_HYPERVISOR_TYPE = 'VMware vCenter Server'
# PORT_STATUS_UP = 'UP'
# PORT_STATUS_DOWN = 'DOWN'
# VM_CREATED = 'VM_CREATED'
# VM_UPDATED = 'VM_UPDATED'
# VM_DELETED = 'VM_DELETED'
# DRIVER_IDLE = 'IDLE'
# DRIVER_READY = 'READY'
# DRIVER_RUNNING = 'RUNNING'
# DRIVER_STOPPED = 'STOPPED'
# DEAD_VLAN = 4095
# AGENT_INITIALIZING = "INITIALIZING"
# AGENT_INITIALIZED = "INITIALIZED"
# AGENT_RUNNING = "RUNNING"
# AGENT_STOPPING = "STOPPING"
# AGENT_STOPPED = "STOPPED"
# SEC_TO_INT_PATCH = "patch-integration"
# INT_TO_SEC_PATCH = "patch-security"
# SG_DROPALL_PRI = 0
# SG_DEFAULT_PRI = 1
# SG_LOW_PRI = 5
# SG_RULES_PRI = 10
# SG_TP_PRI = 20
# SG_TCP_FLAG_PRI = 25
# SG_DROP_HIGH_PRI = 50
# SG_DEFAULT_TABLE_ID = 0
# SG_EGRESS_TABLE_ID = 1
# SG_IP_TABLE_ID = 2
# SG_TCP_TABLE_ID = 2
# SG_UDP_TABLE_ID = 2
# SG_ICMP_TABLE_ID = 2
# SG_LEARN_TABLE_ID = 5
# SG_CANARY_TABLE_ID = 23
# ICMP_ECHO_REQ = 8
# ICMP_ECHO_REP = 0
# ICMP_TIME_EXCEEDED = 11
# ICMP_TS_REQ = 13
# ICMP_TS_REP = 14
# ICMP_INFO_REQ = 15
# ICMP_INFO_REP = 16
# ICMP_AM_REQ = 17
# ICMP_AM_REP = 18
# ICMP_DEST_UNREACH = 3
# THREAD_POOL_SIZE = 5
# RPC_BATCH_SIZE = 30
# SG_RPC_BATCH_SIZE = 10
# DIRECTION_IP_PREFIX = {'ingress': 'source_ip_prefix',
#                        'egress': 'dest_ip_prefix'}
# PROTOCOL = {'icmp': 1,
#             'tcp': 6,
#             'udp': 17,
#             'ipv6-icmp': 58}
# DVS_PORTGROUP_NAME_MAXLEN = 80
# LOGIN_RETRIES = 3
# VM_NETWORK_DEVICE_TYPES = [
#     'VirtualE1000', 'VirtualE1000e', 'VirtualPCNet32',
#     'VirtualSriovEthernetCard', 'VirtualVmxnet']
# CONCURRENT_MODIFICATION_TEXT = 'Cannot complete operation due to concurrent '\
#                                'modification by another operation.'
# LOGIN_PROBLEM_TEXT = "Cannot complete login due to an incorrect "\
#                      "user name or password"
# DELETED_TEXT = "The object has already been deleted or has not been "\
#                "completely created"
# DUPLICATE_NAME = "oslo_vmware.exceptions.DuplicateName"
# RESOURCE_IN_USE = "is in use."
# MIN_EPHEMERAL_PORT = 32768
# MAX_EPHEMERAL_PORT = 65535


import abc
import networking_vsphere.extensions
from neutron.api import extensions
from neutron.api.v2 import attributes
from neutron.api.v2 import resource_helper
from networking_vsphere._i18n import _
from networking_vsphere.common import constants
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.




extensions.append_api_extensions_path(networking_vsphere.extensions.__path__)


def convert_none_to_empty_list(value):
    return [] if value is None else value


def validate_clusters_list(data, valid_values=None):
    """Validate the list of clusters."""
    if not data:
        # Clusters must be provided.
        msg = _("Cannot create a list of clusters from the given input.")
        return msg
    if type(data) is not list:

# Path: networking_vsphere/_i18n.py
# DOMAIN = "networking_vsphere"
# _C = _translators.contextual_form
# _P = _translators.plural_form
# _LI = _translators.log_info
# _LW = _translators.log_warning
# _LE = _translators.log_error
# _LC = _translators.log_critical
# def get_available_languages():
# 
# Path: networking_vsphere/common/constants.py
# AGENT_TYPE_OVSVAPP = "OVSvApp Agent"
# AGENT_TYPE_DVS = 'DVS agent'
# OVSVAPP = 'ovsvapp'
# DVS = 'dvs'
# OVSVAPP_PLUGIN = 'ovsvapp_service_plugin'
# DEVICE = 'device'
# VMWARE_HYPERVISOR_TYPE = 'VMware vCenter Server'
# PORT_STATUS_UP = 'UP'
# PORT_STATUS_DOWN = 'DOWN'
# VM_CREATED = 'VM_CREATED'
# VM_UPDATED = 'VM_UPDATED'
# VM_DELETED = 'VM_DELETED'
# DRIVER_IDLE = 'IDLE'
# DRIVER_READY = 'READY'
# DRIVER_RUNNING = 'RUNNING'
# DRIVER_STOPPED = 'STOPPED'
# DEAD_VLAN = 4095
# AGENT_INITIALIZING = "INITIALIZING"
# AGENT_INITIALIZED = "INITIALIZED"
# AGENT_RUNNING = "RUNNING"
# AGENT_STOPPING = "STOPPING"
# AGENT_STOPPED = "STOPPED"
# SEC_TO_INT_PATCH = "patch-integration"
# INT_TO_SEC_PATCH = "patch-security"
# SG_DROPALL_PRI = 0
# SG_DEFAULT_PRI = 1
# SG_LOW_PRI = 5
# SG_RULES_PRI = 10
# SG_TP_PRI = 20
# SG_TCP_FLAG_PRI = 25
# SG_DROP_HIGH_PRI = 50
# SG_DEFAULT_TABLE_ID = 0
# SG_EGRESS_TABLE_ID = 1
# SG_IP_TABLE_ID = 2
# SG_TCP_TABLE_ID = 2
# SG_UDP_TABLE_ID = 2
# SG_ICMP_TABLE_ID = 2
# SG_LEARN_TABLE_ID = 5
# SG_CANARY_TABLE_ID = 23
# ICMP_ECHO_REQ = 8
# ICMP_ECHO_REP = 0
# ICMP_TIME_EXCEEDED = 11
# ICMP_TS_REQ = 13
# ICMP_TS_REP = 14
# ICMP_INFO_REQ = 15
# ICMP_INFO_REP = 16
# ICMP_AM_REQ = 17
# ICMP_AM_REP = 18
# ICMP_DEST_UNREACH = 3
# THREAD_POOL_SIZE = 5
# RPC_BATCH_SIZE = 30
# SG_RPC_BATCH_SIZE = 10
# DIRECTION_IP_PREFIX = {'ingress': 'source_ip_prefix',
#                        'egress': 'dest_ip_prefix'}
# PROTOCOL = {'icmp': 1,
#             'tcp': 6,
#             'udp': 17,
#             'ipv6-icmp': 58}
# DVS_PORTGROUP_NAME_MAXLEN = 80
# LOGIN_RETRIES = 3
# VM_NETWORK_DEVICE_TYPES = [
#     'VirtualE1000', 'VirtualE1000e', 'VirtualPCNet32',
#     'VirtualSriovEthernetCard', 'VirtualVmxnet']
# CONCURRENT_MODIFICATION_TEXT = 'Cannot complete operation due to concurrent '\
#                                'modification by another operation.'
# LOGIN_PROBLEM_TEXT = "Cannot complete login due to an incorrect "\
#                      "user name or password"
# DELETED_TEXT = "The object has already been deleted or has not been "\
#                "completely created"
# DUPLICATE_NAME = "oslo_vmware.exceptions.DuplicateName"
# RESOURCE_IN_USE = "is in use."
# MIN_EPHEMERAL_PORT = 32768
# MAX_EPHEMERAL_PORT = 65535


# Path: networking_vsphere/extensions/ovsvapp_cluster.py
import abc
import networking_vsphere.extensions
from neutron.api import extensions
from neutron.api.v2 import attributes
from neutron.api.v2 import resource_helper
from networking_vsphere._i18n import _
from networking_vsphere.common import constants

#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.




extensions.append_api_extensions_path(networking_vsphere.extensions.__path__)


def convert_none_to_empty_list(value):
    return [] if value is None else value


def validate_clusters_list(data, valid_values=None):
    """Validate the list of clusters."""
    if not data:
        # Clusters must be provided.
        msg = _("Cannot create a list of clusters from the given input.")
        return msg
    if type(data) is not list:

        msg = _("Given cluster details is not in the form of list.")