Description of problem: ovirt-iso-uploader not parsing ssh login credentials correctly. Version-Release number of selected component (if applicable): ~~~ ovirt-engine-4.3.3.7-0.1.el7.noarch ovirt-iso-uploader-4.3.1-1.el7ev.noarch ~~~ How reproducible: 100% Steps to Reproduce: 1. ovirt-iso-uploader to upload iso to a iso domain. 2. 3. Actual results: ~~~ # engine-iso-uploader -v --ssh-user=root --key-file=/etc/pki/ovirt-engine/keys/engine_id_rsa -i iso upload test.iso Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort): DEBUG: API Vendor(None) API Version(4.3.0) DEBUG: id=220ac4f8-0df6-49ae-bb52-78d122aef4f2 address=XX.XX.XXX.XXX path=/home/test Uploading, please wait... INFO: Start uploading test.iso DEBUG: file (test.iso) DEBUG: /usr/bin/ssh-p22-i /etc/pki/ovirt-engine/keys/engine_id_rsa root.XXX.XXX "/usr/bin/test -e /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso" DEBUG: /usr/bin/ssh-p22-i /etc/pki/ovirt-engine/keys/engine_id_rsa root.XXX.XXX "/usr/bin/test -e /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso" DEBUG: _cmds(['/usr/bin/ssh-p22-i', '/etc/pki/ovirt-engine/keys/engine_id_rsa', 'root.XXX.XXX', '/usr/bin/test -e /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso']) DEBUG: exists returning false DEBUG: Mount point size test command is /usr/bin/ssh-p22-i /etc/pki/ovirt-engine/keys/engine_id_rsa {root@}{XX.XX.XXX.XXX} "{/usr/bin/python} -c 'import os;dir_stat = os.statvfs(\"{/home/test}\"); print (dir_stat.f_bavail * dir_stat.f_frsize)'" ERROR: Unable to copy test.iso to ISO storage domain on iso. ERROR: Error message is "unable to test the available space on /home/test" ~~~ Notice the following lines from the above verbose output: ~~~ DEBUG: /usr/bin/ssh-p22-i /etc/pki/ovirt-engine/keys/engine_id_rsa root.XXX.XXX "/usr/bin/test -e /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso" DEBUG: /usr/bin/ssh-p22-i /etc/pki/ovirt-engine/keys/engine_id_rsa root.XXX.XXX "/usr/bin/test -e /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso" DEBUG: _cmds(['/usr/bin/ssh-p22-i', '/etc/pki/ovirt-engine/keys/engine_id_rsa', 'root.XXX.XXX', '/usr/bin/test -e /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso']) The executed file is: /usr/bin/ssh-p22-i ... The executed file should be: /usr/bin/ssh -p 22 -i ... ~~~ Also the following: ~~~ DEBUG: Mount point size test command is /usr/bin/ssh-p22-i /etc/pki/ovirt-engine/keys/engine_id_rsa {root@}{XX.XX.XXX.XXX} "{/usr/bin/python} -c 'import os;dir_stat = os.statvfs(\"{/home/test}\"); print (dir_stat.f_bavail * dir_stat.f_frsize)'" You can also see that the ssh user and destination are: {root@}{XX.XX.XXX.XXX} They should be: root.XXX.XXX' ~~~ Expected results: Should complete without errors. Additional info: Modified /usr/lib/python2.7/site-packages/ovirt_iso_uploader/__main.py engine-iso-uploader uploads successfully. ~~~ diff /usr/lib/python2.7/site-packages/ovirt_iso_uploader/__main.py /usr/lib/python2.7/site-packages/ovirt_iso_uploader/__main.py-fixed 689c689 < port_flag = "-p" if cmd.startswith(SSH) else "-P" --- > port_flag = " -p" if cmd.startswith(SSH) else " -P" 691c691 < cmd += port_flag + "{0[ssh_port]}".format(self.configuration) --- > cmd += port_flag + " {0[ssh_port]}".format(self.configuration) 693c693 < cmd += "-i {0[key_file]} ".format(self.configuration) --- > cmd += " -i {0[key_file]} ".format(self.configuration) 763,764c763,764 < """ {{{user}}}{{{address}}} "{{{python}}} -c 'import os;""" < """dir_stat = os.statvfs(\\"{{{dir}}}\\"); """ --- > """ {user}{address} "{python} -c 'import os;""" > """dir_stat = os.statvfs(\\"{dir}\\"); """ 1187c1187 < ' {user}{address} "{chmod}' --- > ' {user}{address} "{chmod} ' ~~~ ~~~ ... DEBUG: _cmds(['/usr/bin/ssh', '-p', '22', '-i', '/etc/pki/ovirt-engine/keys/engine_id_rsa', 'root.XXX.XXX', '/bin/mv -fv /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/.test.iso /home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso']) root.XXX.XXX's password: DEBUG: returncode(0) DEBUG: STDOUT(‘/home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/.test.iso’ -> ‘/home/test/220ac4f8-0df6-49ae-bb52-78d122aef4f2/images/11111111-1111-1111-1111-111111111111/test.iso’ ) DEBUG: STDERR() INFO: test.iso uploaded successfully ~~~
Thanks for the report and for the suggested patch!
*** Bug 1723299 has been marked as a duplicate of this bug. ***
Verified in ovirt-iso-uploader-4.3.2-1.el7ev.noarch
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2441
sync2jira