[csw-devel] SF.net SVN: gar:[13088] csw/mgar/gar/v2/lib/python/csw_upload_pkg.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Jan 24 15:21:10 CET 2011


Revision: 13088
          http://gar.svn.sourceforge.net/gar/?rev=13088&view=rev
Author:   wahwah
Date:     2011-01-24 14:21:10 +0000 (Mon, 24 Jan 2011)

Log Message:
-----------
csw-upload-pkg: Warn when not run on 'login'

This script is meant to be run on the 'login' host.  If run elsewhere, it
displays a warning.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/csw_upload_pkg.py

Modified: csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2011-01-24 08:37:06 UTC (rev 13087)
+++ csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2011-01-24 14:21:10 UTC (rev 13088)
@@ -15,6 +15,7 @@
 import opencsw
 import json
 import common_constants
+import socket
 
 
 BASE_URL = "http://buildfarm.opencsw.org/releases/"
@@ -258,11 +259,14 @@
       dest="remove",
       default=False, action="store_true")
   options, args = parser.parse_args()
-  print "args:", args
   if options.debug:
     logging.basicConfig(level=logging.DEBUG)
   else:
     logging.basicConfig(level=logging.INFO)
+  logging.debug("args: %s", args)
+  hostname = socket.gethostname()
+  if not hostname.startswith('login'):
+    logging.warning("This script is meant to be run on the login host.")
   uploader = Srv4Uploader(args, debug=options.debug)
   if options.remove:
     uploader.Remove()


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list