From: Joerg Jaspert Date: Sat, 11 Sep 2010 15:26:49 +0000 (+0200) Subject: Remove old code X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=commitdiff_plain;h=ca9e3716b22771d88dcd7ca2e2f180f9e1707a10 Remove old code Signed-off-by: Joerg Jaspert --- diff --git a/dak/add_user.py b/dak/add_user.py index 354f9050..aed5d53b 100755 --- a/dak/add_user.py +++ b/dak/add_user.py @@ -126,12 +126,6 @@ def main(): if not keyrings: keyrings = Cnf.ValueList("Dinstall::GPGKeyring") -# Ignore the PGP keyring for download of new keys. Ignore errors, if key is missing it will -# barf with the next commands. - cmd = "gpg --no-secmem-warning --no-default-keyring %s --recv-keys %s" \ - % (utils.gpg_keyring_args(keyrings), Cnf["Add-User::Options::Key"]) - (result, output) = commands.getstatusoutput(cmd) - cmd = "gpg --with-colons --no-secmem-warning --no-auto-check-trustdb --no-default-keyring %s --with-fingerprint --list-key %s" \ % (utils.gpg_keyring_args(keyrings), Cnf["Add-User::Options::Key"]) @@ -167,7 +161,6 @@ def main(): continue emails.append(e.group(2)) - print "0x%s -> %s <%s> -> %s -> %s" % (Cnf["Add-User::Options::Key"], name, emails[0], uid, primary_key) prompt = "Add user %s with above data (y/N) ? " % (uid) @@ -176,23 +169,6 @@ def main(): if yn == "y": # Create an account for the user? summary = "" - if Cnf.FindB("Add-User::CreateAccount") or Cnf["Add-User::Options::Create"]: - password = GenPass() - pwcrypt = HashPass(password) - if Cnf.has_key("Add-User::GID"): - cmd = "sudo /usr/sbin/useradd -g users -m -p '%s' -c '%s' -G %s %s" \ - % (pwcrypt, name, Cnf["Add-User::GID"], uid) - else: - cmd = "sudo /usr/sbin/useradd -g users -m -p '%s' -c '%s' %s" \ - % (pwcrypt, name, uid) - (result, output) = commands.getstatusoutput(cmd) - if (result != 0): - utils.fubar("Invocation of '%s' failed:\n%s\n" % (cmd, output), result) - try: - summary+=createMail(uid, password, Cnf["Add-User::Options::Key"], Cnf["Dinstall::GPGKeyring"]) - except: - summary="" - utils.warn("Could not prepare password information for mail, not sending password.") # Now add user to the database. # Note that we provide a session, so we're responsible for committing @@ -200,14 +176,6 @@ def main(): uid_id = uidobj.uid_id session.commit() - # The following two are kicked out in rhona, so we don't set them. kelly adds - # them as soon as she installs a package with unknown ones, so no problems to expect here. - # Just leave the comment in, to not think about "Why the hell aren't they added" in - # a year, if we ever touch uma again. - # maint_id = database.get_or_set_maintainer_id(name) - # session.execute("INSERT INTO fingerprint (fingerprint, uid) VALUES (:fingerprint, uid)", - # {'fingerprint': primary_key, 'uid': uid_id}) - # Lets add user to the email-whitelist file if its configured. if Cnf.has_key("Dinstall::MailWhiteList") and Cnf["Dinstall::MailWhiteList"] != "": f = utils.open_file(Cnf["Dinstall::MailWhiteList"], "a")