summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-16 13:29:01 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-16 13:29:01 -0400
commitaa510b478ab4a3897191fbf352485a244bcbcacf (patch)
treecc3f912d7b267d8c6d5ce26ebd51385cc09ee5c4 /src
parent999f692e1fad2e64c316f31ac9d642bc5231b4d4 (diff)
downloadbcfg2-aa510b478ab4a3897191fbf352485a244bcbcacf.tar.gz
bcfg2-aa510b478ab4a3897191fbf352485a244bcbcacf.tar.bz2
bcfg2-aa510b478ab4a3897191fbf352485a244bcbcacf.zip
random names for repos without obvious names breaks ability to use a single cache for multiple clients
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Packages/Source.py11
-rw-r--r--src/lib/Server/Plugins/Packages/Yum.py1
2 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/Server/Plugins/Packages/Source.py b/src/lib/Server/Plugins/Packages/Source.py
index 5b0aa4213..4362d19ed 100644
--- a/src/lib/Server/Plugins/Packages/Source.py
+++ b/src/lib/Server/Plugins/Packages/Source.py
@@ -1,7 +1,6 @@
import os
import re
import sys
-import base64
import Bcfg2.Server.Plugin
from Bcfg2.Bcfg2Py3k import HTTPError, HTTPBasicAuthHandler, \
HTTPPasswordMgrWithDefaultRealm, install_opener, build_opener, \
@@ -147,12 +146,10 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
if match:
name = match.group(1)
break
- if name is None:
- # couldn't figure out the name from the URL or URL map
- # (which probably means its a screwy URL), so we just
- # generate a random one
- name = base64.b64encode(os.urandom(16))[:-2]
- rname = "%s-%s" % (self.groups[0], name)
+ if name is not None:
+ rname = "%s-%s" % (self.groups[0], name)
+ else:
+ rname = self.groups[0]
# see yum/__init__.py in the yum source, lines 441-449, for
# the source of this regex. yum doesn't like anything but
# string.ascii_letters, string.digits, and [-_.:]. There
diff --git a/src/lib/Server/Plugins/Packages/Yum.py b/src/lib/Server/Plugins/Packages/Yum.py
index d1e97f5b1..44ff1c272 100644
--- a/src/lib/Server/Plugins/Packages/Yum.py
+++ b/src/lib/Server/Plugins/Packages/Yum.py
@@ -4,7 +4,6 @@ import time
import copy
import glob
import socket
-import random
import logging
import threading
import lxml.etree