コード例 #1
0
ファイル: miq_soap.py プロジェクト: jkrocil/cfme_tests
"""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
ファイル: miq_soap.py プロジェクト: pombredanne/cfme_tests
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
ファイル: miq_soap.py プロジェクト: jkrocil/integration_tests
# -*- 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