Пример #1
0
"""SOAP wrapper for CFME.

Enables to operate Infrastructure objects. It has better VM provisioning code. OOP encapsulated.
"""
from suds import WebFault

from utils import lazycache
from utils.conf import cfme_data
from utils.db import cfmedb
from utils.log import logger
from utils.soap import soap_client
from utils.wait import wait_for


if "client" not in globals():
    client = soap_client()  # Ugly, but easiest to use :/


def is_datastore_banned(datastore_name):
    """Checks whether the datastore is in the list of datastores not allowed to use

    Args:
        datastore_name: Name of the datastore
    Returns: :py:class:`bool`
    """
    banned_datastores = cfme_data.get("datastores_not_for_provision", [])
    for banned_datastore in banned_datastores:
        if banned_datastore in datastore_name:
            return True
    else:
        return False
Пример #2
0
def get_client():
    global client
    if client is None:
        client = soap_client()
    return client
Пример #3
0
def get_client():
    global client
    if client is None:
        client = soap_client()
    return client
Пример #4
0
# -*- coding: utf-8 -*-
"""SOAP wrapper for CFME.

Enables to operate Infrastructure objects. It has better VM provisioning code. OOP encapsulated.
"""
from suds import WebFault

from utils import lazycache
from utils.conf import cfme_data
from utils.db import cfmedb
from utils.log import logger
from utils.soap import soap_client
from utils.wait import wait_for

if "client" not in globals():
    client = soap_client()  # Ugly, but easiest to use :/


def is_datastore_banned(datastore_name):
    """Checks whether the datastore is in the list of datastores not allowed to use

    Args:
        datastore_name: Name of the datastore
    Returns: :py:class:`bool`
    """
    banned_datastores = cfme_data.get("datastores_not_for_provision", [])
    for banned_datastore in banned_datastores:
        if banned_datastore in datastore_name:
            return True
    else:
        return False