예제 #1
0
 def get_host(self, _id=None, name=None, address=None, **filters):
     ret = UnityHostList.get(self._cli, name='not found')
     if address:
         host_ip_ports = UnityHostIpPortList.get(self._cli, address=address)
         if host_ip_ports:
             ret = host_ip_ports[0].host
     else:
         ret = self._get_unity_rsc(UnityHostList, _id=_id, name=name,
                                   **filters)
     return ret
예제 #2
0
파일: system.py 프로젝트: crook/storops
 def get_host(self, _id=None, name=None, address=None, **filters):
     ret = UnityHostList.get(self._cli, name='not found')
     if address:
         host_ip_ports = UnityHostIpPortList.get(self._cli, address=address)
         if host_ip_ports:
             ret = host_ip_ports[0].host
     else:
         ret = self._get_unity_rsc(UnityHostList, _id=_id, name=name,
                                   **filters)
     return ret
예제 #3
0
 def test_get_by_ip(self):
     ip_ports = UnityHostIpPortList(cli=t_rest(), address='10.244.209.90')
     assert_that(len(ip_ports), equal_to(1))
     assert_that(ip_ports[0].address, equal_to('10.244.209.90'))
예제 #4
0
 def test_get_all(self):
     ip_ports = UnityHostIpPortList(cli=t_rest())
     assert_that(len(ip_ports), equal_to(8))