def __init__(self, module):
        self.module = module
        self.changed = False
        self.message = {"msg": "Success!", "debug": {
            "module_args": module.params
        }}

        dist_path = os.path.join(self.module.params['girder_dir'],
                                 'girder', 'conf', 'girder.dist.cfg')
        local_path = os.path.join(self.module.params['girder_dir'],
                                  'girder', 'conf', 'girder.local.cfg')

        self.message['debug']['dist_path'] = dist_path
        self.message['debug']['local_path'] = local_path

        self.config = cp.SafeConfigParser()
        # Read in config file
        if not os.path.exists(local_path):
            try:
                self.message['debug']['src'] = dist_path
                self.config.read(dist_path)
            except IOError:
                self.fail("Could not read {}!".format(dist_path))
        else:
            try:
                self.message['debug']['src'] = local_path
                self.config.read(local_path)
            except __HOLE__:
                self.fail("Could not read {}!".format(local_path))

        # Add/Remove plugin
        if self.module.params['state'] == 'present':
            self.add_plugin_dir(self.module.params['plugin_dir'])
        elif self.module.params['state'] == 'absent':
            self.remove_plugin_dir(self.module.params['plugin_dir'])

        # Write out config file
        if self.changed:
            with open(local_path, "wb") as fh:
                self.config.write(fh)

        self.exit()
dataset/ETHPy150Open Kitware/minerva/ansible/library/girder_plugin_dir.py/GirderPluginDirModule.__init__