Author: poeml Date: Fri Nov 27 20:37:50 2009 New Revision: 7868 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7868&view=rev Log: mb new: - show a proper error message if an identifier already exists. see http://mirrorbrain.org/archive/mirrorbrain/0042.html Modified: trunk/mirrordoctor/mirrordoctor.py Modified: trunk/mirrordoctor/mirrordoctor.py URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mirrordoctor.py?rev=7868&r1=7867&r2=7868&view=diff ============================================================================== --- trunk/mirrordoctor/mirrordoctor.py (original) +++ trunk/mirrordoctor/mirrordoctor.py Fri Nov 27 20:37:50 2009 @@ -151,6 +151,16 @@ import urlparse import mb.asn + + try: + # does an existing mirror have the same identifier? They must be unique. + m = self.conn.Server.select(self.conn.Server.q.identifier == identifier)[0] + except IndexError: + pass + else: + sys.exit('Error: a mirror\'s identifier must be unique.\n' + 'There is already a mirror using this identifier. See output of `mb show %s`.\n' + 'Exiting. ' % identifier) if not opts.http: sys.exit('An HTTP base URL needs to be specified') _______________________________________________ mirrorbrain-commits mailing list Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/ Note: To remove yourself from this list, send a mail with the content unsubscribe to the address mirrorbrain-commits-request_at_mirrorbrain.orgReceived on Fri Nov 27 2009 - 19:37:53 GMT
This archive was generated by hypermail 2.2.0 : Fri Nov 27 2009 - 19:45:08 GMT