MCPcopy Create free account
hub / github.com/apache/cloudstack / executeFromFile

Method executeFromFile

python/lib/cloudutils/db.py:68–81  ·  view source on GitHub ↗
(self, file)

Source from the content-addressed store, hash-verified

66 raise CloudRuntimeException("Failed to Connect to DB")
67
68 def executeFromFile(self, file):
69 if not os.path.exists(file):
70 return False
71
72 cmdLine = "mysql --host=" + self.host + " --port=" + str(self.port) + " --user=" + self.username
73 if self.password is not None:
74 cmdLine += " --password=" + self.password
75
76 cmdLine += " < " + file
77
78 try:
79 bash(cmdLine)
80 except:
81 raise CloudRuntimeException("Failed to execute " + cmdLine)

Callers

nothing calls this directly

Calls 3

bashClass · 0.85
existsMethod · 0.65

Tested by

no test coverage detected