git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3293f9
)
allow hpc_service and rr_service to be None when calling write_slices_file
author
Scott Baker
<smbaker@gmail.com>
Fri, 3 Jan 2014 20:00:59 +0000
(12:00 -0800)
committer
Scott Baker
<smbaker@gmail.com>
Fri, 3 Jan 2014 20:00:59 +0000
(12:00 -0800)
planetstack/hpc_observer/hpclib.py
patch
|
blob
|
history
diff --git
a/planetstack/hpc_observer/hpclib.py
b/planetstack/hpc_observer/hpclib.py
index
e91a468
..
5375c2f
100644
(file)
--- a/
planetstack/hpc_observer/hpclib.py
+++ b/
planetstack/hpc_observer/hpclib.py
@@
-62,14
+62,18
@@
class HpcLibrary:
return mapping
return mapping
- def write_slices_file(self, hpc_service, rr_service):
+ def write_slices_file(self, hpc_service=None, rr_service=None):
+ if (hpc_service is None):
+ hpc_service = HpcService.objects.get()
+
+ if (rr_service is None):
+ rr_service = RequestRouterService.objects.get()
+
mapping = self.extract_slice_info(hpc_service)
rr_mapping = self.extract_slice_info(rr_service)
mapping.update(rr_mapping)
mapping = self.extract_slice_info(hpc_service)
rr_mapping = self.extract_slice_info(rr_service)
mapping.update(rr_mapping)
- print mapping
-
fn = "/tmp/slices"
f = open(fn, "w")
fn = "/tmp/slices"
f = open(fn, "w")
@@
-95,9
+99,7
@@
PUPPET_MASTER_PORT="8140"
""" % mapping)
if __name__ == '__main__':
""" % mapping)
if __name__ == '__main__':
- hpc_service = HpcService.objects.get()
- rr_service = RequestRouterService.objects.get()
lib = HpcLibrary()
lib = HpcLibrary()
- lib.write_slices_file(
hpc_service, rr_service
)
+ lib.write_slices_file()