Madhu Pavan has uploaded a new change for review. Change subject: tests: InterfaceSampleTests are failing with IOError ......................................................................
tests: InterfaceSampleTests are failing with IOError Both testHostSampleHandlesDisappearingVlanInterfaces and testHostSampleReportsNewInterface are failing due to IOError: No such file or directory: '/etc/pki/vdsm/keys/libvirt_password'. Both the testcases are lookng for libvirt_password file which will be installed with package installation. It is not appropriate for a testcase to look for a file which will be installed after the package is installed. Current changes will allow testcases to look for the libvirt_password file in sources if the file is not present in '/etc/pki/vdsm/keys/libvirt_password' location. Change-Id: Iee3d33f29745176f46ab243824cde82f8783f77e Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1195594 Signed-off-by: Madhu Pavan Kothapally <k...@linux.vnet.ibm.com> --- M lib/vdsm/constants.py.in M lib/vdsm/libvirtconnection.py 2 files changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/38105/1 diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in index 89bdebd..e6afbd6 100644 --- a/lib/vdsm/constants.py.in +++ b/lib/vdsm/constants.py.in @@ -81,7 +81,7 @@ P_VDSM_CONF = '@CONFDIR@/' P_VDSM_KEYS = '/etc/pki/vdsm/keys/' P_VDSM_LIBVIRT_PASSWD = P_VDSM_KEYS + 'libvirt_password' -P_VDSM_CERT = '/etc/pki/vdsm/certs/vdsmcert.pem' +M_SRC_LIBVIRT_PASSWD = '@abs_top_srcdir@/' + 'vdsm/libvirt_password' P_VDSM_CLIENT_LOG = '@VDSMRUNDIR@/client.log' P_VDSM_LOG = '@VDSMLOGDIR@' diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py index 3c2ecad..99d5573 100644 --- a/lib/vdsm/libvirtconnection.py +++ b/lib/vdsm/libvirtconnection.py @@ -78,9 +78,12 @@ def _read_password(): - with open(constants.P_VDSM_LIBVIRT_PASSWD) as passwd_file: - return passwd_file.readline().rstrip("\n") - + if os.path.exists(constants.P_VDSM_LIBVIRT_PASSWD): + with open(constants.P_VDSM_LIBVIRT_PASSWD) as passwd_file: + return passwd_file.readline().rstrip("\n") + else: + with open(constants.P_VDSM_SRC_LIBVIRT_PASSWD) as passwd_file: + return passwd_file.readline().rstrip("\n") def open_connection(uri=None, username=None, passwd=None): """ by calling this method you are getting a new and unwrapped connection -- To view, visit http://gerrit.ovirt.org/38105 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee3d33f29745176f46ab243824cde82f8783f77e Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Madhu Pavan <k...@linux.vnet.ibm.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches