Exemplo n.º 1
0
 def test_create_simple_host(self):
     host = UnityHost.create(t_rest(), name='host1',
                             host_type=HostTypeEnum.HOST_MANUAL,
                             os='customized os')
     assert_that(host.get_id(), equal_to('Host_11'))
     assert_that(host.name, equal_to('host1'))
     assert_that(host.os_type, equal_to('customized os'))
Exemplo n.º 2
0
 def test_create_simple_host(self):
     host = UnityHost.create(t_rest(), name='host1',
                             host_type=HostTypeEnum.HOST_MANUAL,
                             os='customized os')
     assert_that(host.get_id(), equal_to('Host_11'))
     assert_that(host.name, equal_to('host1'))
     assert_that(host.os_type, equal_to('customized os'))
Exemplo n.º 3
0
    def create_host(self, name, host_type=None, desc=None, os=None):
        host = UnityHostList.get(self._cli, name=name).first_item
        if host and host.existed:
            raise ex.UnityHostNameInUseError()
        else:
            host = UnityHost.create(self._cli, name, host_type=host_type,
                                    desc=desc, os=os)

        return host
Exemplo n.º 4
0
    def create_host(self, name, host_type=None, desc=None, os=None,
                    tenant=None):
        host = UnityHostList.get(self._cli, name=name)
        if host:
            raise storops.exception.UnityHostNameInUseError()
        else:
            host = UnityHost.create(self._cli, name, host_type=host_type,
                                    desc=desc, os=os, tenant=tenant)

        return host
Exemplo n.º 5
0
    def create_host(self, name, host_type=None, desc=None, os=None):
        host = UnityHostList.get(self._cli, name=name)
        if host:
            raise ex.UnityHostNameInUseError()
        else:
            host = UnityHost.create(self._cli,
                                    name,
                                    host_type=host_type,
                                    desc=desc,
                                    os=os)

        return host