Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Unidata/awips2-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mjames-upc committed Nov 6, 2015
2 parents a78782f + f991cd8 commit 4bd9ff9
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 87 deletions.
3 changes: 2 additions & 1 deletion .config_AII_global
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,8 @@ function initialize_configuration_variables {
color_echo red 1 "\tERROR: No ${EDEX_HOME}/data/utility/common_static/base/textdb/national_category_table.template ... Exiting"
exit 1
else
cccid=$( grep ^K${locSite} ${EDEX_HOME}/data/utility/common_static/base/textdb/national_category_table.template | awk '{print $2}' )
#cccID=$( grep ^K${locSite} ${EDEX_HOME}/data/utility/common_static/base/textdb/national_category_table.template | awk '{print $2}' )
cccID=${1}
fi
fi
Expand Down
17 changes: 7 additions & 10 deletions vmgfe/convertColorTables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/python/bin/python
#!/awips2/python/bin/python
################################################################################
# #
# Program name: convertColorTables.py #
Expand All @@ -14,15 +14,16 @@
# Program description: Converts AWIPS I GFE Color Table files into AWIPS II #
# cmap files. #
# #
# Directory program runs from: /awips/dev/awips2 as root on dx1. #
# Directory program runs from: /tmp/dev/awips2 as root on dx1. #
# #
# Other needed configuration: need colormaps/GFE under /awips/dev/awips2 #
# Other needed configuration: need colormaps/GFE under /tmp/dev/awips2 #
# #
# Program History: #
# *** Version 1.3 *** #
# 03/23/11: Created script. vtm #
# *** Version 1.5 *** #
# 07/06/11: Now using GFE_unmangler to clean up file names. vtm #
# 11/06/15: mjames@ucar: use AWIPS 2 python and run standalone #
################################################################################
# import statements
import sys,re,os,string,time
Expand All @@ -31,12 +32,9 @@
from GFE_unmangler import *

# configuration section
WORKDIR="/awips/dev/awips2/"
WORKDIR="/tmp/dev/awips2/"

# Check to see if script is running on the correct server and user.
if "adam1" not in gethostname():
print "Script is not running on adam1.\n\nProgram will now die."
exit()
# Check to see if script is running by the correct user.
if string.replace(os.popen("whoami").read(),"\n","") != "root":
print "Script is not running as root.\n\nProgram will now die."
exit()
Expand Down Expand Up @@ -135,7 +133,7 @@
os.system(cmd)
print "colortable.tar file has been created."
time.sleep(2)
# move file to adam1 and untar it. Change permissions.
# move file and untar it. Change permissions.
#print "Get ready to enter root password two times..."
if A2USER != "SITE":
destPath = "/awips2/edex/data/utility/cave_static/user/" + A2USER
Expand All @@ -154,5 +152,4 @@
cmd = "cd " + destPath + " ; tar -xvf " + WORKDIR + "colortable.tar ; rm -f " + WORKDIR + "colortable.tar"
cmd = cmd + " ; find . -type d -exec chmod 775 {} \; ; find . -type f -exec chmod 664 {} \; ; chown -R awips:fxalpha ./*"
os.system(cmd)
#print "tar file unpacked on adam1 and permissions/ownership set."
print "script is done!"
37 changes: 5 additions & 32 deletions vmgfe/convertEditAreas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/python/bin/python
#!/awips2/python/bin/python
################################################################################
# #
# Program name: convertEditAreas.py #
Expand All @@ -14,11 +14,11 @@
# Program description: Converts AWIPS I GFE Edit Area and Edit Area Groups #
# files into AWIPS II xml files. #
# #
# Directory program runs from: /awips/dev/awips2 as root on dx1. #
# Directory program runs from: /tmp/dev/awips2 as root on dx1. #
# #
# Other needed configuration: need gfe/editAreas, gfe/editAreaGroups, and #
# gfebaseline/editAreaGroups subdirectories under #
# /awips/dev/awips2 #
# /tmp/dev/awips2 #
# #
# Program History: #
# *** Version 1.0 *** #
Expand All @@ -42,6 +42,7 @@
# 07/06/11: Can now store SITE level configurations on awips 2. vtm #
# *** Version 1.6 *** #
# 07/02/14 Fixed conversion of edit area group files. Some cleanup. ryu/ASM #
# 11/06/15: mjames@ucar: use AWIPS 2 python and run standalone #
################################################################################
# import statements
import sys,re,os,string
Expand All @@ -52,10 +53,7 @@
# configuration section
WORKDIR="/var/tmp/sdc/vmgfe/"

# Check to see if script is running on the correct server and user.
if "adam1" not in gethostname():
print "Script is not running on adam1.\n\nProgram will now die."
exit()
# Check to see if script is running by the correct user.
if string.replace(os.popen("whoami").read(),"\n","") != "root":
print "Script is not running as root.\n\nProgram will now die."
exit()
Expand Down Expand Up @@ -192,20 +190,6 @@
# closing the xml file
oFile.close()

# clean out directory
#cmd = "rm " + WORKDIR + "gfe/editAreaGroups/*.txt"
#os.system(cmd)

# clean out baseline directory
#cmd = "rm " + WORKDIR + "gfebaseline/editAreaGroups/*.txt"
#os.system(cmd)

# move baseline edit area group files from adam to AWIPS I -- changed for wrap into config_awip2
#print "Get ready to provide root password for adam1..."
#cmd = "scp root@adam1:" + baseGroupDir + "*.txt " + WORKDIR + "gfebaseline/editAreaGroups/"
#cmd = "scp " + baseGroupDir + "*.txt " + WORKDIR + "gfebaseline/editAreaGroups/"
#os.system(cmd)

# set the directory of where the AWIPS 1 edit area groups are
awips1dir="/data/local/gfe_editareas/" + A1USER

Expand Down Expand Up @@ -267,17 +251,6 @@
#os.system(cmd)
#print "editarea.tar file has been created."

# move file to adam1 and untar it. Change permissions.
#print "Get ready to enter root password two times..."
#print "getting ready to untar...."
#if A2USER != "SITE":
# destPath = "/awips2/edex/data/utility/common_static/user/" + A2USER
#else:
# destPath = "/awips2/edex/data/utility/common_static/site/" + siteID
#cmd = "cd " + WORKDIR + " ; tar -C + " + destPath + " -xf editarea.tar "
#os.system(cmd)
#print "tar file moved to adam1"
#cmd = "ssh root@adam1 \"cd " + destPath + " ; tar xvf editarea.tar ; rm -f editarea.tar ; "
cmd = "cd " + destPath + " ; find . -type d -exec chmod 775 {} \; ; find . -type f -exec chmod 664 {} \; ; chown -R awips:fxalpha ./*"
os.system(cmd)
print "Permissions/ownership set."
Expand Down
18 changes: 7 additions & 11 deletions vmgfe/convertGfeConfigs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/python/bin/python
#!/awips2/python/bin/python
################################################################################
# #
# Program name: convertGfeConfigs.py #
Expand All @@ -13,16 +13,17 @@
# #
# Program description: Moves AWIPS I GFE config files into AWIPS II files. #
# #
# Directory program runs from: /awips/dev/awips2 as root on dx1. #
# Directory program runs from: /tmp/dev/awips2 as root on dx1. #
# #
# Other needed configuration: need gfe/userPython/gfeConfig under #
# /awips/dev/awips2 #
# /tmp/dev/awips2 #
# #
# Program History: #
# *** Version 1.4 *** #
# 03/31/11: Created script. vtm #
# *** Version 1.5 *** #
# 07/06/11: Now using GFE_unmangler to clean up file names. vtm #
# 11/06/15: mjames@ucar: use AWIPS 2 python and run standalone #
################################################################################
# import statements
import sys,re,os,string
Expand All @@ -31,12 +32,9 @@
from GFE_unmangler import *

# configuration section
WORKDIR="/awips/dev/awips2/"
WORKDIR="/tmp/dev/awips2/"

# Check to see if script is running on the correct server and user.
if "adam1" not in gethostname():
print "Script is not running on adam1.\n\nProgram will now die."
exit()
# Check to see if script is running on by correct user.
if string.replace(os.popen("whoami").read(),"\n","") != "root":
print "Script is not running as root.\n\nProgram will now die."
exit()
Expand Down Expand Up @@ -94,8 +92,6 @@
os.system(cmd)
print "gfeconfig.tar file has been created."

# move file to adam1 and untar it. Change permissions.
#print "Get ready to enter root password two times..."
if A2USER != "SITE":
destPath = "/awips2/edex/data/utility/cave_static/user/" + A2USER
else:
Expand All @@ -112,5 +108,5 @@
cmd = "cd " + WORKDIR + " ; tar -C " + destPath + " -xvf gfeconfig.tar ; rm -f gfeconfig.tar ; "
cmd = cmd + "cd " + destPath + " ; find . -type d -exec chmod 775 {} \; ; find . -type f -exec chmod 664 {} \; ; chown -R awips:fxalpha ./*"
os.system(cmd)
print "tar file unpacked on adam1 and permissions/ownership set."
print "tar file unpacked and permissions/ownership set."
print "script is done!"
18 changes: 7 additions & 11 deletions vmgfe/convertSamples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/python/bin/python
#!/awips2/python/bin/python
# -*- coding: utf-8 -*-
################################################################################
# #
Expand All @@ -15,9 +15,9 @@
# Program description: Converts AWIPS I GFE Edit Sample Set files into AWIPS #
# II xml files. #
# #
# Directory program runs from: /awips/dev/awips2 as root on dx1. #
# Directory program runs from: /tmp/dev/awips2 as root on dx1. #
# #
# Other needed configuration: need gfe/sampleSets under /awips/dev/awips2 #
# Other needed configuration: need gfe/sampleSets under /tmp/dev/awips2 #
# #
# Program History: #
# *** Version 1.2 *** #
Expand All @@ -29,6 +29,7 @@
# *** Version 1.5 *** #
# 07/06/11: Now using GFE_unmangler to clean up file names. vtm #
# 07/06/11: Can now store SITE level configurations on awips 2. vtm #
# 11/06/15: mjames@ucar: use AWIPS 2 python and run standalone #
################################################################################
# import statements
import sys,re,os,string
Expand All @@ -37,12 +38,9 @@
from GFE_unmangler import *

# configuration section
WORKDIR="/awips/dev/awips2/"
WORKDIR="/tmp/dev/awips2/"

# Check to see if script is running on the correct server and user.
if "adam1" not in gethostname():
print "Script is not running on adam1.\n\nProgram will now die."
exit()
# Check to see if script is running by the correct user.
if string.replace(os.popen("whoami").read(),"\n","") != "root":
print "Script is not running as root.\n\nProgram will now die."
exit()
Expand Down Expand Up @@ -125,8 +123,6 @@
os.system(cmd)
print "sampleset.tar file has been created."

# move file to adam1 and untar it. Change permissions.
#print "Get ready to enter root password two times..."
if A2USER != "SITE":
destPath = "/awips2/edex/data/utility/common_static/user/" + A2USER
else:
Expand All @@ -143,5 +139,5 @@
cmd = "cd " + WORKDIR + " ; tar -C " + destPath + " -xvf sampleset.tar ; rm -f sampleset.tar ; cd " + destPath
cmd = cmd + " ; find . -type d -exec chmod 775 {} \; ; find . -type f -exec chmod 664 {} \; ; chown -R awips:fxalpha ./*"
os.system(cmd)
print "tar file unpacked on adam1 and permissions/ownership set."
print "tar file unpacked and permissions/ownership set."
print "script is done!"
18 changes: 7 additions & 11 deletions vmgfe/convertTimeRanges.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/python/bin/python
#!/awips2/python/bin/python
################################################################################
# #
# Program name: convertTimeRanges.py #
Expand All @@ -14,26 +14,24 @@
# Program description: Moves AWIPS I GFE Time Range files into AWIPS II files.#
# Some file naming required. #
# #
# Directory program runs from: /awips/dev/awips2 as root on dx1. #
# Directory program runs from: /tmp/dev/awips2 as root on dx1. #
# #
# Other needed configuration: need gfe/text/selecttr under /awips/dev/awips2 #
# Other needed configuration: need gfe/text/selecttr under /tmp/dev/awips2 #
# #
# Program History: #
# *** Version 1.4 *** #
# 03/17/11: Created script. vtm #
# 11/06/15: mjames@ucar: use AWIPS 2 python and run standalone #
################################################################################
# import statements
import sys,re,os,string
from sys import argv
from socket import gethostname

# configuration section
WORKDIR="/awips/dev/awips2/"
WORKDIR="/tmp/dev/awips2/"

# Check to see if script is running on the correct server and user.
if "adam1" not in gethostname():
print "Script is not running on adam1.\n\nProgram will now die."
exit()
# Check to see if script is running by the correct user.
if string.replace(os.popen("whoami").read(),"\n","") != "root":
print "Script is not running as root.\n\nProgram will now die."
exit()
Expand Down Expand Up @@ -91,8 +89,6 @@
os.system(cmd)
print "timerange.tar file has been created."

# move file to adam1 and untar it. Change permissions.
#print "Get ready to enter root password two times..."
if A2USER != "SITE":
destPath = "/awips2/edex/data/utility/common_static/user/" + A2USER
else:
Expand All @@ -109,5 +105,5 @@
cmd = "cd " + WORKDIR + " ; tar -C " + destPath + " -xvf timerange.tar ; rm -f timerange.tar ; cd " + destPath
cmd = cmd + " ; find . -type d -exec chmod 775 {} \; ; find . -type f -exec chmod 664 {} \; ; chown -R awips:fxalpha ./*"
os.system(cmd)
print "tar file unpacked on adam1 and permissions/ownership set."
print "tar file unpacked and permissions/ownership set."
print "script is done!"
19 changes: 8 additions & 11 deletions vmgfe/convertWeGroups.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/python/bin/python
#!/awips2/python/bin/python
################################################################################
# #
# Program name: convertWeGroups.py #
Expand All @@ -14,13 +14,14 @@
# Program description: Converts AWIPS I GFE Weather Element Group files into #
# AWIPS II xml files. #
# #
# Directory program runs from: /awips/dev/awips2 as root on dx1. #
# Directory program runs from: /tmp/dev/awips2 as root on dx1. #
# #
# Other needed configuration: need gfe/weGroups under /awips/dev/awips2 #
# Other needed configuration: need gfe/weGroups under /tmp/dev/awips2 #
# #
# Program History: #
# *** Version 1.5 *** #
# 07/06/11: Created script. vtm #
# 11/06/15: mjames@ucar: use AWIPS 2 python and run standalone #
################################################################################
# import statements
import sys,re,os,string
Expand All @@ -29,12 +30,9 @@
from GFE_unmangler import *

# configuration section
WORKDIR="/awips/dev/awips2/"
WORKDIR="/tmp/dev/awips2/"

# Check to see if script is running on the correct server and user.
if "adam1" not in gethostname():
print "Script is not running on adam1.\n\nProgram will now die."
exit()
# Check to see if script is running by the correct user.
if string.replace(os.popen("whoami").read(),"\n","") != "root":
print "Script is not running as root.\n\nProgram will now die."
exit()
Expand Down Expand Up @@ -118,8 +116,7 @@
os.system(cmd)
print "wegroups.tar file has been created."

# move file to adam1 and untar it. Change permissions.
#print "Get ready to enter root password two times..."
# move file nd untar it. Change permissions.
if A2USER != "SITE":
destPath = "/awips2/edex/data/utility/cave_static/user/" + A2USER
else:
Expand All @@ -136,5 +133,5 @@
cmd = "cd " + WORKDIR + " ; tar -C " + destPath + " -xvf wegroups.tar ; rm -f wegroups.tar ; "
cmd = cmd + "cd " + destPath + " ; find . -type d -exec chmod 775 {} \; ; find . -type f -exec chmod 664 {} \; ; chown -R awips:awips ./*"
os.system(cmd)
print "tar file unpacked on adam1 and permissions/ownership set."
print "tar file unpacked and permissions/ownership set."
print "script is done!"

0 comments on commit 4bd9ff9

Please sign in to comment.