mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Port the file module over to the new common code infrastructure + cleanup some redundant imports since the module code already imports those things.
This commit is contained in:
@@ -26,19 +26,16 @@ else:
|
||||
# PostgreSQL module specific support methods.
|
||||
#
|
||||
|
||||
|
||||
def db_exists(cursor, db):
|
||||
query = "SELECT * FROM pg_database WHERE datname=%(db)s"
|
||||
cursor.execute(query, {'db': db})
|
||||
return cursor.rowcount == 1
|
||||
|
||||
|
||||
def db_delete(cursor, db):
|
||||
query = "DROP DATABASE %s" % db
|
||||
cursor.execute(query)
|
||||
return True
|
||||
|
||||
|
||||
def db_create(cursor, db):
|
||||
query = "CREATE DATABASE %s" % db
|
||||
cursor.execute(query)
|
||||
@@ -48,7 +45,6 @@ def db_create(cursor, db):
|
||||
# Module execution.
|
||||
#
|
||||
|
||||
|
||||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
|
||||
Reference in New Issue
Block a user