[PATCH] supybot-fedora: add mirroradmins command

Matt Domsch Matt_Domsch at dell.com
Tue Nov 17 05:54:36 UTC 2009


>From dac6dbbaef266c668e32249c9d15f766b65c00d2 Mon Sep 17 00:00:00 2001
From: Matt Domsch <Matt_Domsch at dell.com>
Date: Mon, 16 Nov 2009 23:53:04 -0600
Subject: [PATCH] add mirroradmins command

---
 plugin.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/plugin.py b/plugin.py
index b36a050..d40683b 100644
--- a/plugin.py
+++ b/plugin.py
@@ -373,6 +373,19 @@ class Fedora(callbacks.Plugin):
         irc.reply(string.encode('utf-8'))
     wikilink = wrap(wikilink, ['text'])
 
+    def mirroradmins(self, irc, msg, args, hostname):
+        """<hostname>
+
+        Return MirrorManager list of FAS usernames which administer <hostname>.
+        <hostname> must be the FQDN of the host."""
+        url = "https://admin.fedoraproject.org/mirrormanager/mirroradmins?tg_format=json&host=" + hostname
+        result = self._load_json(url)['values']
+        if len(result) == 0:
+            irc.reply('Hostname "%s" not found' % hostname)
+            return
+        string = 'Mirror Admins of %s: ' + ' '.join(result)
+        irc.reply(string.encode('utf-8'))
+    mirroradmins = wrap(mirroradmins)
 
 Class = Fedora
 
-- 
1.6.5.2


Once I can push a new MM that implements this interface.

-- 
Matt Domsch
Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux




More information about the infrastructure mailing list