|
Revision 2158, 1.4 kB
(checked in by brian, 1 year ago)
|
Moved some of the libexec scripts around; perl to attic.
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
import sys, time, os |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
sys.path.append(os.path.expandvars("$GIP_LOCATION/lib/python")) |
|---|
| 7 |
from gip_common import config, getTemplate, getLogger, printTemplate |
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
log = getLogger("GIP.timestamp") |
|---|
| 11 |
|
|---|
| 12 |
def main(): |
|---|
| 13 |
try: |
|---|
| 14 |
|
|---|
| 15 |
cp = config() |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
epoch = str(time.time()) |
|---|
| 19 |
now = time.strftime("%a %b %d %T UTC %Y", time.gmtime()) |
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
template = getTemplate("GlueCluster", "GlueLocationLocalID") |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
info = {'locationId': 'TIMESTAMP', |
|---|
| 27 |
'subClusterId': cp.get('ce', 'name'), |
|---|
| 28 |
'clusterId': cp.get('ce', 'name'), |
|---|
| 29 |
'locationName': 'TIMESTAMP', |
|---|
| 30 |
'version': epoch, |
|---|
| 31 |
'path': now, |
|---|
| 32 |
} |
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
printTemplate(template, info) |
|---|
| 36 |
|
|---|
| 37 |
except Exception, e: |
|---|
| 38 |
|
|---|
| 39 |
log.error(e) |
|---|
| 40 |
sys.stdout = sys.stderr |
|---|
| 41 |
raise |
|---|
| 42 |
|
|---|
| 43 |
if __name__ == '__main__': |
|---|
| 44 |
main() |
|---|
| 45 |
|
|---|