示例#1
0
文件: test_host.py 项目: mattmb/spoke
 def test_get_missing_next_free_uuid(self):
     """Retrieve missing next free uuid; raise NotFound"""
     next_uuid = SpokeHostUUID()
     next_uuid.delete()
     next_uuid.__init__()
     self.assertRaises(error.NotFound, next_uuid.get)
     next_uuid.create(self.next_uuid_start)
示例#2
0
文件: test_host.py 项目: mattmb/spoke
 def tearDown(self):
     """Delete test organisation and host"""
     host = SpokeHost(self.org_name)
     host.delete(self.host_name)
     org = SpokeOrg()
     org.delete(self.org_name, self.org_children)
     next_uuid = SpokeHostUUID()
     next_uuid.delete()
示例#3
0
文件: test_host.py 项目: mattmb/spoke
 def test_create_next_free_uuid(self):
     """Create next free uuid; return uuid as list."""
     next_uuid = SpokeHostUUID()
     next_uuid.delete()
     # Re init so it detects the delete
     next_uuid.__init__()
     result = next_uuid.create(self.next_uuid_start)
     expected_data = [1]
     self.assertEqual(result['data'], expected_data)
示例#4
0
文件: test_host.py 项目: mattmb/spoke
 def test_create_next_free_uuid_non_integer(self):
     """Create next free uuid with non integer; raise InputError."""
     next_uuid = SpokeHostUUID()
     next_uuid.delete()
     # Re init so it detects the delete
     next_uuid.__init__()
     next_uuid_start = 'three'
     self.assertRaises(error.InputError, next_uuid.create, next_uuid_start)
     next_uuid.create(self.next_uuid_start)
示例#5
0
文件: test_host.py 项目: mattmb/spoke
 def test_create_next_free_uuid_mac(self):
     """Create next free uuid + mac; return as tuple."""
     next_uuid = SpokeHostUUID()
     next_uuid.delete()
     # Re init so it detects the delete
     next_uuid.__init__()
     result = next_uuid.create(self.next_uuid_start, get_mac=True)
     expected_data = (1, '02:00:00:01:00:00')
     self.assertEqual(result['data'], expected_data)
示例#6
0
文件: host.py 项目: KrisSaxton/spoke
def uuid_delete():
    try:
        conf = _spoke_config(_salt_config('config'))
        uuid = SpokeHostUUID()
        result = uuid.delete()
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
示例#7
0
文件: host.py 项目: KrisSaxton/spoke
def uuid_delete():
    try:
        conf = _spoke_config(_salt_config('config'))
        uuid = SpokeHostUUID()
        result = uuid.delete()
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
示例#8
0
文件: host.py 项目: mattmb/spoke
def uuid_delete():
    try:
        from spoke.lib.host import SpokeHostUUID
        uuid = SpokeHostUUID()
        result = uuid.delete()
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result
示例#9
0
文件: host.py 项目: mattmb/spoke
def uuid_delete():
    try:
        from spoke.lib.host import SpokeHostUUID

        uuid = SpokeHostUUID()
        result = uuid.delete()
    except error.SpokeError as e:
        result = common.handle_error(e)
    return result