def put_meta(module, cf, container, src, dest, meta, clear_meta):
 objs = None
 if (src and dest):
  module.fail_json(msg='Error: ambiguous instructions; files to set meta have been specified on both src and dest args')
 elif dest:
  objs = dest
 else:
  objs = src
 objs = objs.split(',')
 objs = map(str.strip, objs)
 c = _get_container(module, cf, container)
 results = []
 for obj in objs:
  try:
   result = c.get_object(obj).set_metadata(meta, clear=clear_meta)
  except Exception as e:
   module.fail_json(msg=e.message)
  else:
   results.append(result)
 EXIT_DICT['container'] = c.name
 EXIT_DICT['success'] = True
 if results:
  EXIT_DICT['changed'] = True
  EXIT_DICT['num_changed'] = True
 module.exit_json(**EXIT_DICT)

def put_meta ( module , cf , container , src , dest , meta , clear_meta ) : objs = None if ( src and dest ) : module . fail_json ( msg = 'Error: ambiguous instructions; files to set meta have been specified on both src and dest args' ) elif dest : objs = dest else : objs = src objs = objs . split ( ',' ) objs = map ( str . strip , objs ) c = _get_container ( module , cf , container ) results = [ ] for obj in objs : try : result = c . get_object ( obj ) . set_metadata ( meta , clear = clear_meta ) except Exception as e : module . fail_json ( msg = e . message ) else : results . append ( result ) EXIT_DICT [ 'container' ] = c . name EXIT_DICT [ 'success' ] = True if results : EXIT_DICT [ 'changed' ] = True EXIT_DICT [ 'num_changed' ] = True module . exit_json ( ** EXIT_DICT )
set metadata on a container .