#1823 MM hotfix: fix umdl
Closed: Fixed None Opened 11 years ago by mdomsch.

= phenomenon =
python tracebacks in umdl due to a regexp failing to find something I thought it should. Resulting in some portions of the tree (alt or secondary content trees it seems) not being accurately reflected in MM's database.
= reason =
incorrect regexp

= recommendation =
server/update-master-directory-list | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ea7f4b85926e72088e3d616638563e2fca6db2fc
Author: Matt Domsch Matt_Domsch@dell.com
Date: Tue Nov 17 17:02:14 2009 -0600

umdl: fix crash in _get_version_from_path()

Fixes this traceback when a dir does not have an identifyable version
in it, yet we're trying to make a repository for it.  Unclear what dir
is causing this though.

Traceback (most recent call last):
  File "./update-master-directory-list", line 485, in ?
  File "./update-master-directory-list", line 477, in main
    sync_directories_from_directory(i['path'], i['category'],
  File "./update-master-directory-list", line 446, in
    sync_category_directories(category, category_directories)
  File "./update-master-directory-list", line 339, in
    make_repository(dir, category)
  File "./update-master-directory-list", line 199, in make_repository
    (ver, arch) = guess_ver_arch_from_path(category, path)
  File "./update-master-directory-list", line 85, in
    ver = create_version_from_path(category, path)
  File "./update-master-directory-list", line 53, in
    vname = _get_version_from_path(path)
  File "./update-master-directory-list", line 49, in
    return m.group(1)
AttributeError: 'NoneType' object has no attribute 'group'

diff --git a/server/update-master-directory-list b/server/update-master-directory-list
index 1582e82..b71e2dc 100755
--- a/server/update-master-directory-list
+++ b/server/update-master-directory-list
@@ -46,7 +46,9 @@ def rename_SRPMS_source(l):
def _get_version_from_path(path):
s = r'/(([.\d]+)(-\w+)?)/'
m = re.search(re.compile(s), path)
- return m.group(1)
+ if m is not None:
+ return m.group(1)
+ return None

def create_version_from_path(category, path):
ver = None

does this still need to be applied to servers?

It's hotpatched on bapp01, and is in the new MM built in epel-testing I need to push ASAP (but not tonight). Please don't touch until I get to it. :-) Same for any other MM hotfix tickets.

new MM is in production. Done.

Login to comment on this ticket.