ONOS scenario according to wanted config file structure
[fuel.git] / deploy / common.py
index 17fd217..bc27876 100644 (file)
@@ -39,16 +39,23 @@ LOG.addHandler(out_handler)
 os.chmod(LOGFILE, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
 
 def exec_cmd(cmd, check=True):
+    nul_f = open(os.devnull, 'w')
     process = subprocess.Popen(cmd,
                                stdout=subprocess.PIPE,
-                               stderr=subprocess.STDOUT,
+                               stderr=nul_f,
                                shell=True)
+    nul_f.close()
     response = process.communicate()[0].strip()
     return_code = process.returncode
     if check:
         if return_code > 0:
+            print "Failed command: " + str(cmd)
+            print "Command returned response: " + str(response)
+            print "Command return code: " + str(return_code)
             raise Exception(response)
         else:
+            print "Command: " + str(cmd)
+            print str(response)
             return response
     return response, return_code