예제 #1
0
def make_policies(limits):
    policies = {}
    for (name, member_capacity, project_capacity) in limits:
        try:
            member_capacity = units.parse(member_capacity)
            project_capacity = units.parse(project_capacity)
        except units.ParseError:
            m = "Please specify capacity as a decimal integer"
            raise CommandError(m)
        policies[name] = {"member_capacity": member_capacity,
                          "project_capacity": project_capacity}
    return policies
예제 #2
0
def make_policies(limits):
    policies = {}
    for (name, member_capacity, project_capacity) in limits:
        try:
            member_capacity = units.parse(member_capacity)
            project_capacity = units.parse(project_capacity)
        except units.ParseError:
            m = "Please specify capacity as a decimal integer"
            raise CommandError(m)
        policies[name] = {"member_capacity": member_capacity,
                          "project_capacity": project_capacity}
    return policies
예제 #3
0
def parse_with_unit(value):
    try:
        return units.parse(value)
    except units.ParseError:
        raise CommandError("Failed to parse value, should be an integer, "
                           "possibly followed by a unit, or 'inf'.")
예제 #4
0
def parse_with_unit(value):
    try:
        return units.parse(value)
    except units.ParseError:
        raise CommandError("Failed to parse value, should be an integer, "
                           "possibly followed by a unit, or 'inf'.")
예제 #5
0
파일: projects.py 프로젝트: konsP/synnefo
def _parse_max_members(s):
    try:
        return units.parse(s)
    except units.ParseError:
        raise faults.BadRequest("Invalid max_members")
예제 #6
0
def _parse_max_members(s):
    try:
        return units.parse(s)
    except units.ParseError:
        raise faults.BadRequest("Invalid max_members")