示例#1
0
def test_create_quota():
    try:
        sdk_quota.create_quota("jenkins", cpus=4.0, mem=4000)
        quotas = sdk_quota.list_quotas()

        present = False
        for quota in quotas['infos']:
            if quota['role'] == "jenkins":
                present = True
                break

        assert present, "There was no quota present for the jenkins role"

    finally:
        sdk_quota.remove_quota("jenkins")

        quotas = sdk_quota.list_quotas()
        if 'infos' in quotas:
            for quota in quotas['infos']:
                assert quota['role'] != "jenkins"
示例#2
0
def _set_quota(role, cpus):
    sdk_quota.create_quota(role, cpus=cpus)
示例#3
0
def _set_quota(role, cpus, memory, quota_type):
    sdk_quota.create_quota(role, cpus=cpus, mem=memory, quota_type=quota_type)
示例#4
0
def _set_quota(role, cpus, memory):
    sdk_quota.create_quota(role, cpus=cpus, mem=memory)