예제 #1
0
파일: host.py 프로젝트: KrisSaxton/spoke
def uuid_reserve(qty=1, get_mac=False):
    try:
        conf = _spoke_config(_salt_config('config'))
        uuid = SpokeHostUUID()
        result = uuid.modify(qty, get_mac)
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
예제 #2
0
파일: host.py 프로젝트: KrisSaxton/spoke
def uuid_reserve(qty=1, get_mac=False):
    try:
        conf = _spoke_config(_salt_config('config'))
        uuid = SpokeHostUUID()
        result = uuid.modify(qty, get_mac)
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
예제 #3
0
파일: host.py 프로젝트: mattmb/spoke
def uuid_reserve(qty=1, get_mac=False):
    try:
        from spoke.lib.host import SpokeHostUUID
        uuid = SpokeHostUUID()
        result = uuid.modify(qty, get_mac)
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
예제 #4
0
 def test_increment_and_get_multiple_next_free_uuid_and_mac(self):
     """Get next 4 free uuids and macs; return uuids as list of integers."""
     next_uuid = SpokeHostUUID()
     result = next_uuid.modify(4, get_mac=True)
     expected_data = ([1, 2, 3, 4], [
         '02:00:00:01:00:00', '02:00:00:02:00:00', '02:00:00:03:00:00',
         '02:00:00:04:00:00'
     ])
     self.assertEquals(result['data'], expected_data)
예제 #5
0
파일: host.py 프로젝트: mattmb/spoke
def uuid_reserve(qty=1, get_mac=False):
    try:
        from spoke.lib.host import SpokeHostUUID

        uuid = SpokeHostUUID()
        result = uuid.modify(qty, get_mac)
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
예제 #6
0
파일: test_host.py 프로젝트: mattmb/spoke
 def test_increment_and_get_multiple_next_free_uuid_and_mac(self):
     """Get next 4 free uuids and macs; return uuids as list of integers."""
     next_uuid = SpokeHostUUID()
     result = next_uuid.modify(4, get_mac=True)
     expected_data = ([1, 2, 3, 4], ['02:00:00:01:00:00', '02:00:00:02:00:00', '02:00:00:03:00:00', '02:00:00:04:00:00'])
     self.assertEquals(result['data'], expected_data)
예제 #7
0
파일: test_host.py 프로젝트: mattmb/spoke
 def test_increment_and_get_multiple_next_free_uuid(self):
     """Get next 4 free uuids; return uuids as list of integers."""
     next_uuid = SpokeHostUUID()
     result = next_uuid.modify(4)
     expected_data = [1, 2, 3, 4]
     self.assertEquals(result['data'], expected_data)
예제 #8
0
파일: test_host.py 프로젝트: mattmb/spoke
 def test_update_and_get_next_free_uuid_mac(self):
     """Get next free uuid and mac; return as tuple."""
     next_uuid = SpokeHostUUID()
     result = next_uuid.modify(get_mac=True)
     expected_data = ([1], ['02:00:00:01:00:00'])
     self.assertEquals(result['data'], expected_data)
예제 #9
0
파일: test_host.py 프로젝트: mattmb/spoke
 def test_update_and_get_next_free_uuid(self):
     """Get next free uuid; return uuid as list."""
     next_uuid = SpokeHostUUID()
     result = next_uuid.modify()
     expected_data = [1]
     self.assertEquals(result['data'], expected_data)