Makefile | 6 +++++- mirrorlist-server/mirrorlist_server.py | 7 ++++++- server/mirrormanager/hostconfig.py | 4 ++-- server/mirrormanager/model.py | 10 +++++++--- server/mirrormanager/xmlrpc.py | 4 ++-- 5 files changed, 22 insertions(+), 9 deletions(-)
New commits: commit cd11efdce0e5b50b7cffd41cc5057f831e602968 Author: Matt Domsch Matt_Domsch@dell.com Date: Thu Nov 17 22:47:59 2011 -0600
report_mirror prints an error if no paths match
https://fedorahosted.org/mirrormanager/ticket/37
diff --git a/server/mirrormanager/hostconfig.py b/server/mirrormanager/hostconfig.py index 49fc14e..8ffcf88 100644 --- a/server/mirrormanager/hostconfig.py +++ b/server/mirrormanager/hostconfig.py @@ -70,5 +70,5 @@ def read_host_config(config): if h.count() != 1: return (None, 'Config file host name for site not found.\n') host = h[0] - message = host.checkin(config) - return (True, message) + rc, message = host.checkin(config) + return (rc, message) diff --git a/server/mirrormanager/model.py b/server/mirrormanager/model.py index 34c92fb..af9f932 100644 --- a/server/mirrormanager/model.py +++ b/server/mirrormanager/model.py @@ -211,6 +211,7 @@ class Host(SQLObject):
def _uploaded_config(self, config): + rc = True message = ''
def _config_categories(config): @@ -290,9 +291,12 @@ class Host(SQLObject): deleted += 1
message += "Category %s directories updated: %s added: %s deleted %s\n" % (category.name, marked_up2date, added, deleted) + if (marked_up2date == 0 and deleted == 0 and added == 0): + message += u'Error: Report did not include any known directories for this category. Please check the path= values in report_mirror.conf.\n' + rc = False hc.sync()
- return message + return rc, message
def is_admin_active(self): @@ -313,10 +317,10 @@ class Host(SQLObject): self.lastCheckedIn = datetime.utcnow()
def checkin(self, config): - message = self._uploaded_config(config) + rc, message = self._uploaded_config(config) self.config = config self.sync() - return message + return rc, message
def has_category(self, cname): return HostCategory.selectBy(host=self, category=Category.byName(cname)).count() > 0 diff --git a/server/mirrormanager/xmlrpc.py b/server/mirrormanager/xmlrpc.py index 989b404..e5db380 100644 --- a/server/mirrormanager/xmlrpc.py +++ b/server/mirrormanager/xmlrpc.py @@ -12,8 +12,8 @@ class XmlrpcController(controllers.Controller): @expose() def checkin(self, p): config = pickle.loads(bz2.decompress(base64.urlsafe_b64decode(p))) - r, message = read_host_config(config) - if r is not None: + rc, message = read_host_config(config) + if rc == True: return message + 'checked in successful' else: return message + 'error checking in'
commit a283e0a4471d3e9f197abd8e838cdd5c5c8675e2 Author: Matt Domsch Matt_Domsch@dell.com Date: Thu Nov 17 22:25:57 2011 -0600
report version in metalink
fixes https://bugzilla.redhat.com/show_bug.cgi?id=701047
diff --git a/Makefile b/Makefile index 694d519..3f65f9f 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_VERSION)
SPEC=mirrormanager.spec RELEASE_PY=server/mirrormanager/release.py +VERSION_PY=mirrorlist-server/mirrormanager_version.py TARBALL=dist/$(RELEASE_STRING).tar.bz2 STARTSCRIPT=server/start-mirrormanager PROGRAMDIR=/usr/share/mirrormanager/server @@ -27,7 +28,10 @@ $(SPEC): $(RELEASE_PY): sed -e 's/##VERSION##/$(RELEASE_VERSION)/' $(RELEASE_PY).in > $(RELEASE_PY)
-prep: $(SPEC) $(RELEASE_PY) +$(VERSION_PY): + echo "mirrormanager_version = u'$(RELEASE_VERSION)'" > $(VERSION_PY) + +prep: $(SPEC) $(RELEASE_PY) $(VERSION_PY) pushd server ;\ python setup.py egg_info echo 'db_module=mirrormanager.model' > server/mirrormanager.egg-info/sqlobject.txt diff --git a/mirrorlist-server/mirrorlist_server.py b/mirrorlist-server/mirrorlist_server.py index fd9f8c6..151d258 100755 --- a/mirrorlist-server/mirrorlist_server.py +++ b/mirrorlist-server/mirrorlist_server.py @@ -16,6 +16,11 @@ from IPy import IP import GeoIP from weighted_shuffle import weighted_shuffle
+try: + from mirrormanager_version import mirrormanager_version +except: + mirrormanager_version=u'dev' + # can be overridden on the command line socketfile = '/var/run/mirrormanager/mirrorlist_server.sock' cachefile = '/var/lib/mirrormanager/mirrorlist_cache.pkl' @@ -101,7 +106,7 @@ def metalink_header(): doc += '<metalink version="3.0" xmlns="http://www.metalinker.org/"' doc += ' type="dynamic"' doc += ' pubdate="%s"' % pubdate - doc += ' generator="mirrormanager"' + doc += ' generator="mirrormanager/%s"' % mirrormanager_version doc += ' xmlns:mm0="http://fedorahosted.org/mirrormanager"' doc += '>\n' return doc
mirrormanager-commits@lists.fedorahosted.org