Checks if the specified bank contains the specified key.
(bank, key)
| 329 | |
| 330 | |
| 331 | def contains(bank, key): |
| 332 | """ |
| 333 | Checks if the specified bank contains the specified key. |
| 334 | """ |
| 335 | _init_client() |
| 336 | if key is None: |
| 337 | data = (bank,) |
| 338 | query = "SELECT COUNT(data) FROM {} WHERE bank=%s".format( |
| 339 | __context__["mysql_table_name"] |
| 340 | ) |
| 341 | else: |
| 342 | data = (bank, key) |
| 343 | query = "SELECT COUNT(data) FROM {} WHERE bank=%s AND etcd_key=%s".format( |
| 344 | __context__["mysql_table_name"] |
| 345 | ) |
| 346 | cur, _ = run_query(__context__.get("mysql_client"), query, args=data) |
| 347 | r = cur.fetchone() |
| 348 | cur.close() |
| 349 | return r[0] == 1 |
| 350 | |
| 351 | |
| 352 | def updated(bank, key): |
nothing calls this directly
no test coverage detected