def put_logging(Bucket, TargetBucket=None, TargetPrefix=None, TargetGrants=None, region=None, key=None, keyid=None, profile=None):
 try:
  conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
  logstate = {}
  targets = {'TargetBucket': TargetBucket, 'TargetGrants': TargetGrants, 'TargetPrefix': TargetPrefix}
  for (key, val) in six.iteritems(targets):
   if (val is not None):
    logstate[key] = val
  if logstate:
   logstatus = {'LoggingEnabled': logstate}
  else:
   logstatus = {}
  if ((TargetGrants is not None) and isinstance(TargetGrants, six.string_types)):
   TargetGrants = json.loads(TargetGrants)
  conn.put_bucket_logging(Bucket=Bucket, BucketLoggingStatus=logstatus)
  return {'updated': True, 'name': Bucket}
 except ClientError as e:
  return {'updated': False, 'error': __utils__['boto3.get_error'](e)}

def put_logging ( Bucket , TargetBucket = None , TargetPrefix = None , TargetGrants = None , region = None , key = None , keyid = None , profile = None ) : try : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) logstate = { } targets = { 'TargetBucket' : TargetBucket , 'TargetGrants' : TargetGrants , 'TargetPrefix' : TargetPrefix } for ( key , val ) in six . iteritems ( targets ) : if ( val is not None ) : logstate [ key ] = val if logstate : logstatus = { 'LoggingEnabled' : logstate } else : logstatus = { } if ( ( TargetGrants is not None ) and isinstance ( TargetGrants , six . string_types ) ) : TargetGrants = json . loads ( TargetGrants ) conn . put_bucket_logging ( Bucket = Bucket , BucketLoggingStatus = logstatus ) return { 'updated' : True , 'name' : Bucket } except ClientError as e : return { 'updated' : False , 'error' : __utils__ [ 'boto3.get_error' ] ( e ) }
given a valid config .