Пример #1
0
def domain(request):
    if version.current_version() < "5.3":
        return None
    domain = automate.Domain(name=fauxfactory.gen_alphanumeric(), enabled=True)
    domain.create()
    request.addfinalizer(lambda: domain.delete() if domain.exists() else None)
    return domain
Пример #2
0
def copy_methods(domain):
    methods = ['rejected', 'validate_quotas']
    for method in methods:
        ocls = automate.Class(name="ProvisionRequestQuotaVerification",
            namespace=automate.Namespace.make_path("Infrastructure", "VM",
                "Provisioning", "StateMachines",
                parent=automate.Domain(name="ManageIQ (Locked)")))

        method = automate.Method(name=method, cls=ocls)

        method = method.copy_to(domain)
Пример #3
0
def copy_domains(domain):
    methods = ['openstack_PreProvision', 'openstack_CustomizeRequest']
    for method in methods:
        ocls = automate.Class(
            name="Methods",
            namespace=automate.Namespace.make_path(
                "Cloud",
                "VM",
                "Provisioning",
                "StateMachines",
                parent=automate.Domain(name="ManageIQ (Locked)")))

        method = automate.Method(name=method, cls=ocls)

        method = method.copy_to(domain)