Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix some typos, strange problems with os filehandles.

  • Loading branch information...
commit 678deec898bece98faaded0c1b3d64122c7266b8 1 parent 5ce1490
@oldpatricka oldpatricka authored
Showing with 13 additions and 10 deletions.
  1. +13 −10 epuharness/harness.py
View
23 epuharness/harness.py
@@ -176,7 +176,7 @@ def start(self, deployment_file=None, deployment_str=None):
def _start_epum(self, name, config,
exe_name="epu-management-service"):
- """Starts a provisioner with SupervisorD
+ """Starts an epum with SupervisorD
@param name: name of epum to start
@param config: an epum config
@@ -225,8 +225,8 @@ def _build_epum_config(self, name, exchange, config, logfile=None):
config_yaml = yaml.dump(merged_config)
(os_handle, config_filename) = tempfile.mkstemp(suffix='.yml')
- os.write(os_handle, config_yaml)
- os.close(os_handle)
+ with open(config_filename, "w") as config_f:
+ config_f.write(config_yaml)
return config_filename
@@ -255,9 +255,12 @@ def _build_provisioner_config(self, name, exchange, config, logfile=None):
default = {
'server':{
- "exchange": exchange
+ 'amqp':{
+ 'exchange': exchange
+ }
},
'provisioner':{
+ 'topic': name,
},
'logging': {
'loggers': {
@@ -286,8 +289,8 @@ def _build_provisioner_config(self, name, exchange, config, logfile=None):
config_yaml = yaml.dump(merged_config)
(os_handle, config_filename) = tempfile.mkstemp(suffix='.yml')
- os.write(os_handle, config_yaml)
- os.close(os_handle)
+ with open(config_filename, "w") as config_f:
+ config_f.write(config_yaml)
return config_filename
@@ -358,8 +361,8 @@ def _build_process_dispatcher_config(self, exchange, name, config,
config_yaml = yaml.dump(merged_config)
(os_handle, config_filename) = tempfile.mkstemp(prefix="%s_" % name, suffix='.yml')
- os.write(os_handle, config_yaml)
- os.close(os_handle)
+ with open(config_filename, "w") as config_f:
+ config_f.write(config_yaml)
return config_filename
@@ -457,8 +460,8 @@ def _build_eeagent_config(self, exchange, name, process_dispatcher, launch_type,
config_yaml = yaml.dump(config)
(os_handle, config_filename) = tempfile.mkstemp(suffix='.yml')
- os.write(os_handle, config_yaml)
- os.close(os_handle)
+ with open(config_filename, "w") as config_f:
+ config_f.write(config_yaml)
return config_filename
Please sign in to comment.
Something went wrong with that request. Please try again.