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:
Michael DeHaan 2012-07-30 21:50:32 -04:00
commit ce5f3dd148
15 changed files with 174 additions and 246 deletions

View file

@ -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(