def _acl_to_acp(self, acl):
   '''
   Translate AccessControlList to AccessControlPolicy.
   '''
   if acl is not None:
     acp = AccessControlPolicy(dict())
     owner = Owner()
     owner.id = self._access_key
     acp.owner = owner
     acp.access_control_list = acl.get_grant_list()
     return acp
   return ''
 def get_bucket_acl(self, bucket_name):
   '''
   Get the ACL of a specified bucket.
   :param bucket_name: The name of the bucket to get ACL
   :return: The got access control list
   '''
   uri = '%s%s?%s' % (self._config.get_base_uri(), bucket_name,
     SubResource.ACL)
   response = self._request.get(uri, auth=self._auth)
   if response.status_code == requests.codes.ok:
     acp = AccessControlPolicy(to_json_object(response.content))
     acl = self._acp_to_acl(acp)
     return acl
   else:
     headers = ""
     if self._config.debug:
       headers = ' header=%s' % response.headers
     message = 'Get bucket acl failed, status=%s, reason=%s%s' % (
       response.status_code, response.content, headers)
     raise GalaxyFDSClientException(message)