예제 #1
0
def validate_workers(workers):
    if not isinstance(workers, list):
        raise ConfigurationError('Workers must be of type list.  Found ' +
                                 str(type(workers)) + '.')

    if len(workers) < 1:
        raise ConfigurationError('Must specify at least one worker')

    for worker in workers:
        validate_host(worker)
    return workers
예제 #2
0
def validate_workers(workers):
    if not isinstance(workers, list):
        raise ConfigurationError('Workers must be of type list.  Found ' +
                                 str(type(workers)) + '.')

    if len(workers) < 1:
        raise ConfigurationError('Must specify at least one worker')

    for worker in workers:
        validate_host(worker)
    return workers
예제 #3
0
def validate_coordinator(coordinator):
    validate_host(coordinator)
    return coordinator
예제 #4
0
def validate_coordinator(coordinator):
    validate_host(coordinator)
    return coordinator
예제 #5
0
 def test_valid_hostname(self):
     host = "master"
     self.assertEqual(validators.validate_host(host), host)
예제 #6
0
 def test_valid_full_ipv6(self):
     ipv6 = "FE80:0000:0000:0000:0202:B3FF:FE1E:8329"
     self.assertEqual(validators.validate_host(ipv6), ipv6)
예제 #7
0
 def test_valid_collapsed_ipv6(self):
     ipv6 = "FE80::0202:B3FF:FE1E:8329"
     self.assertEqual(validators.validate_host(ipv6), ipv6)
예제 #8
0
 def test_valid_ipv4(self):
     ipv4 = "10.14.1.10"
     self.assertEqual(validators.validate_host(ipv4), ipv4)
예제 #9
0
 def test_valid_hostname(self):
     host = "master"
     self.assertEqual(validators.validate_host(host), host)
예제 #10
0
 def test_valid_collapsed_ipv6(self):
     ipv6 = "FE80::0202:B3FF:FE1E:8329"
     self.assertEqual(validators.validate_host(ipv6), ipv6)
예제 #11
0
 def test_valid_full_ipv6(self):
     ipv6 = "FE80:0000:0000:0000:0202:B3FF:FE1E:8329"
     self.assertEqual(validators.validate_host(ipv6), ipv6)
예제 #12
0
 def test_valid_ipv4(self):
     ipv4 = "10.14.1.10"
     self.assertEqual(validators.validate_host(ipv4), ipv4)