Print

Print


Commit in java/sandbox/data-cat/scripts on MAIN
hps_datacat_find.py+1-3638 -> 639
hps_datacat_register_file.py+19-6638 -> 639
+20-9
2 modified files
Small script changes before I move them.

java/sandbox/data-cat/scripts
hps_datacat_find.py 638 -> 639
--- java/sandbox/data-cat/scripts/hps_datacat_find.py	2014-05-29 02:21:34 UTC (rev 638)
+++ java/sandbox/data-cat/scripts/hps_datacat_find.py	2014-05-30 21:58:23 UTC (rev 639)
@@ -6,12 +6,10 @@
 author: Jeremy McCormick <[log in to unmask]> 
 """
 
-# TODO: set properly Run Min, Run Max, and Events by dataset.
-
 import argparse, os.path, subprocess
 
 # path to script at SLAC
-script_cmd = '~srs/datacat/prod/datacat find'
+script_cmd = '~srs/datacat/prod/datacat-hps find'
 
 # default options for search command
 script_options = '--search-groups --recurse'

java/sandbox/data-cat/scripts
hps_datacat_register_file.py 638 -> 639
--- java/sandbox/data-cat/scripts/hps_datacat_register_file.py	2014-05-29 02:21:34 UTC (rev 638)
+++ java/sandbox/data-cat/scripts/hps_datacat_register_file.py	2014-05-30 21:58:23 UTC (rev 639)
@@ -6,16 +6,26 @@
 author: Jeremy McCormick <[log in to unmask]> 
 """
 
-# TODO: set properly Run Min, Run Max, and Events by dataset.
+import argparse, os.path, subprocess, socket, getpass
 
-import argparse, os.path, subprocess
-
 # path to script at SLAC
-script_cmd = '~srs/datacat/prod/datacat registerDataset'
+script_cmd = '~srs/datacat/prod/datacat-hps registerDataset'
 
-# default SLAC account for SSH connection
-connection = [log in to unmask]
+# setup default connection
+connection = None
+domainname = socket.getfqdn()
+username = getpass.getuser()
 
+# FIXME: Make something like this work so JLAB users can connect to a generic account at SLAC.
+#if 'jlab' in domainname:
+#    if 'clashps' in username:
+        # FIXME: In fact this account sucks for this purpose!
+#        connection = [log in to unmask]
+#        connection = [log in to unmask]
+#elif 'slac' in domainname:
+if 'slac' in domainname:
+    connection = 'ssh [log in to unmask] % getpass.getuser()
+
 # lowest level node in directory hierarchy
 group = 'HPS'
 
@@ -72,6 +82,9 @@
 if args['connection'] != None:
     connection = args['connection']
     
+if connection == None:
+    raise Exception("Couldn't figure out a connection to use!")    
+    
 dry_run = False
 if args['dry_run']:
     dry_run = True
SVNspam 0.1