Bug 994825 - Couldn't get plugins list info when the content of "/etc/ovirt-plugins.d/ovirt-node-plugin-puppet" is null
Summary: Couldn't get plugins list info when the content of "/etc/ovirt-plugins.d/ovir...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-node
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.4.1
Assignee: Ryan Barry
QA Contact: bugs@ovirt.org
URL:
Whiteboard: node
Depends On:
Blocks: 1006844
TreeView+ depends on / blocked
 
Reported: 2013-08-08 05:31 UTC by haiyang,dong
Modified: 2014-04-30 10:56 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-30 10:56:40 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 18191 0 None None None Never

Description haiyang,dong 2013-08-08 05:31:25 UTC
Description of problem:
Using edit-node install ovirt-node-plugin-puppet into ovirt-node-iso,
then check that the file "/etc/ovirt-plugins.d/ovirt-node-plugin-puppet":
cat /etc/ovirt-plugins.d/ovirt-node-plugin-puppet
-----------------------------------
Name:ovirt-node-plugin-puppet
Version:ovirt-node-plugin-puppet-3.1.0-0.999.20130722032114git68f34db.fc18.noarch
Install Date:Mon Jul 22 05:21:52 2013

Then using the function "get_plugins_list" of plugins_page.py to get plugins list info
list_info=get_plugins_list()
print list_info
{'ovirt-node-plugin-puppet': ('ovirt-node-plugin-puppet-3.1.0-0.999.20130722032114git68f34db.fc18.noarch', 'Mon Jul 22 05:21:52 2013')}

But when clean the content of "/etc/ovirt-plugins.d/ovirt-node-plugin-puppet"
cat /dev/null >/etc/ovirt-plugins.d/ovirt-node-plugin-puppet
Couldn't get plugins list info  by using "get_plugins_list"

According to the code of "get_plugins_list()" of  plugins_page.py
124     def get_plugins_list(self):
125         plugin_dict = {}
126         plugin_dir = "/etc/ovirt-plugins.d/"
127         if os.path.exists(plugin_dir):
128             for f in os.listdir(plugin_dir):
129                 if not f.endswith(".minimize"):
130                     with open(plugin_dir + f) as p:
131                         if re.compile(r'Name:.*?\nVer.*:.*?\nInstall Date:.*',
132                                       re.M | re.S).match(open(plugin_dir + f
133                                                               ).read()):
134                             #Hopefully a plugin metadata file
135                             lines = p.readlines()
136                             name = lines[0].strip().split(":")[1]
137                             ver = lines[1].strip().split(":")[1]
138                             install_date = lines[2].strip().replace(
139                                 "Install Date:", "")
140                         else:
141                             try:
142                                 cmd = '/bin/rpm -qf %s/%s --qf %%{name}' % \
143                                     (plugin_dir, f)
144                                 package = process.check_output(cmd.split(' ')
145                                                                ).strip()
146                                 cmd = "rpm -q %s --qf 'NAME: %s DATE: \
147                                        %%{version}-%%{release}.%%{arch} INST: \
148                                        %%{INSTALLTIMEate}\\n'" %\
149                                     (package, package)
150                                 name, ver, install_date = re.match(
151                                     r'NAME: (.*?) DATE: (.*?) INST: (.*)',
152                                     process.check_output(cmd, shell=True
153                                                          ).strip()).groups()
154                             except CalledProcessError:
155                                 continue
156 
157                     plugin_dict[name] = (ver, install_date)
158         return plugin_dict

we should still get plugins list info when clean the content of "/etc/ovirt-plugins.d/ovirt-node-plugin-puppet".
Actually the issue happens in line 142-145:
[root@localhost admin]# /bin/rpm -qf /etc/ovirt-plugins.d/ovirt-node-plugin-puppet --qf %{name}
file /etc/ovirt-plugins.d/ovirt-node-plugin-puppet is not owned by any package



Version-Release number of selected component (if applicable):
ovirt-node-iso-3.1.0-0.999.999.20130807225755gitfa08ac6.59.fc18.iso


How reproducible:
100%

Steps to Reproduce:

   

Actual results:


Expected results:


Additional info:

Comment 1 Sandro Bonazzola 2014-03-04 09:19:12 UTC
This is an automated message.
Re-targeting all non-blocker bugs still open on 3.4.0 to 3.4.1.


Note You need to log in before you can comment on or make changes to this bug.