mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07: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:
parent
8e60ad986a
commit
ce5f3dd148
15 changed files with 174 additions and 246 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue