Simone Tiraboschi has uploaded a new change for review.

Change subject: upload: getting host address for local iso domain on remote host
......................................................................

upload: getting host address for local iso domain on remote host

Correclty getting the host address for local iso domain on remote
host to be able to upload via SSH

Change-Id: I9f408f842225709b5b3c89a709354a845ad2003e
Bug-Url: https://bugzilla.redhat.com/1097789
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M src/__main__.py
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-iso-uploader 
refs/changes/44/37444/1

diff --git a/src/__main__.py b/src/__main__.py
index 73133e6..8001cc3 100644
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -652,10 +652,21 @@
             storage = sd.get_storage()
             if storage is not None:
                 domain_type = storage.get_type()
-                address = 'localhost'
-                if domain_type not in ('localfs', ):
+                address = ''
+                if domain_type == 'localfs':
+                    hosts = self.api.hosts.list(query="storage=%s" % isodomain)
+                    for host in hosts:
+                        address = host.get_address()
+                else:
                     address = storage.get_address()
                 path = storage.get_path()
+                if len(address) == 0:
+                    raise Exception(
+                        _(
+                            "An host was not found for "
+                            "the %s local ISO domain."
+                        ) % isodomain
+                    )
             else:
                 raise Exception(
                     _(


-- 
To view, visit http://gerrit.ovirt.org/37444
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f408f842225709b5b3c89a709354a845ad2003e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-iso-uploader
Gerrit-Branch: ovirt-iso-uploader-3.5
Gerrit-Owner: Simone Tiraboschi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to