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

Method execute

python/lib/cloudutils/db.py:37–57  ·  view source on GitHub ↗
(self, statement)

Source from the content-addressed store, hash-verified

35 database=self.db)
36
37 def execute(self, statement):
38 txn = None
39 try:
40 txn = self.connect()
41 cursor = txn.cursor()
42 cursor.execute(statement)
43 cursor.close()
44 txn.commit()
45 if txn is not None:
46 try:
47 txn.close()
48 except:
49 pass
50 except:
51 raise CloudRuntimeException("Failed to execute: %s " % statement)
52 finally:
53 if txn is not None:
54 try:
55 txn.close()
56 except:
57 pass
58
59 def testConnection(self):
60 try:

Callers 1

configMethod · 0.95

Calls 5

connectMethod · 0.95
executeMethod · 0.65
closeMethod · 0.65
commitMethod · 0.45

Tested by

no test coverage detected