[node-patches] Change in ovirt-node[master]: Tweak edit-node's naming

rbarry at redhat.com rbarry at redhat.com
Wed Oct 1 17:43:50 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Tweak edit-node's naming
......................................................................

Tweak edit-node's naming

Be better about naming downstream images which don't contain a
distro, and make the naming a bit friendlier.

Change-Id: Ib4a734b449e337992d51068248c4701ac2f7a40c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1027643
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M tools/edit-node
1 file changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/80/33680/1

diff --git a/tools/edit-node b/tools/edit-node
index db5f965..3ba812a 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -1721,8 +1721,13 @@
     >>> fn = "ovirt-node-iso-2.6.1-20120228.fc18.iso"
     >>> isoname_to_nvr(fn)
     ('ovirt-node-iso', '2.6.1', '20120228', 'dummyarch', 'fc18')
+    >>> fn = "rhev-hypervisor7-7.0-20140926.0.iso"
+    >>> isoname_to_nvr(fn)
+    ('rhev-hypervisor7', '7.0', '20140926.0', 'dummyarch', 'dummydist')
     """
     newfn = re.sub("\.(iso)$", "", isofilename)
+    if not re.search(r'(\.fc\d+\.?)|(\.el\d\.?)', newfn):
+        newfn += ".dummydist"
     newfn += ".dummyarch"
     return filename_to_nvra(newfn)
 
@@ -1738,7 +1743,12 @@
     >>> edited_iso = "ovirt-node-iso-2.6.1-20120228.fc18.iso.edited.iso"
     >>> plugins = ["ovirt-node-plugin-igor-slave", "3rd-plugin-cim"]
     >>> build_isoname_for_plugins(edited_iso, plugins)
-    'ovirt-node-iso-2.6.1-20120228.igor-slave_3rd-plugin-cim.fc18.iso'
+    'ovirt-node-iso-2.6.1-20120228.fc18-igor-slave_3rd-plugin-cim.iso'
+    >>> rhevh_edited = "rhev-hypervisor7-7.0-20140926.0.iso.edited.iso"
+    >>> rhevh_plugins = ["ovirt-node-plugin-snmp", "ovirt-node-plugin-ipmi",
+    ...                  "ovirt-node-plugin-cim", "3rd-party"]
+    >>> build_isoname_for_plugins(rhevh_edited, rhevh_plugins)
+    'rhev-hypervisor7-7.0-20140926.0-snmp_ipmi_cim_3rd-party.iso'
     """
     def sane_name_for_plugin(plugin):
         package = os.path.basename(plugin)
@@ -1768,12 +1778,13 @@
     try:
         nvra = isoname_to_nvr(editname_prefix)
         #print "edited nvra", nvra
-        isoname = "{name}-{version}-{release}.{packages}.{distro}.iso".format(
+        distro = "" if nvra[4] == "dummydist" else ".%s" % nvra[4]
+        isoname = "{name}-{version}-{release}{distro}-{packages}.iso".format(
             name=nvra[0],
             version=nvra[1],
             release=nvra[2],
             packages=packages,
-            distro=nvra[4])
+            distro=distro)
     except Exception as e:
         logging.exception("ISO Filename '%s' doesn't follow NVRA scheme" %
                           editname_prefix, e)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4a734b449e337992d51068248c4701ac2f7a40c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list