def put_policy(Bucket, Policy, region=None, key=None, keyid=None, profile=None):
 try:
  conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
  if (Policy is None):
   Policy = '{}'
  elif (not isinstance(Policy, six.string_types)):
   Policy = json.dumps(Policy)
  conn.put_bucket_policy(Bucket=Bucket, Policy=Policy)
  return {'updated': True, 'name': Bucket}
 except ClientError as e:
  return {'updated': False, 'error': __utils__['boto3.get_error'](e)}

def put_policy ( Bucket , Policy , region = None , key = None , keyid = None , profile = None ) : try : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) if ( Policy is None ) : Policy = '{}' elif ( not isinstance ( Policy , six . string_types ) ) : Policy = json . dumps ( Policy ) conn . put_bucket_policy ( Bucket = Bucket , Policy = Policy ) return { 'updated' : True , 'name' : Bucket } except ClientError as e : return { 'updated' : False , 'error' : __utils__ [ 'boto3.get_error' ] ( e ) }
given a valid config .