示例#1
0
 def provision_swift(self):
     """
     Create the Swift containers if necessary.
     """
     if self.storage_type == self.SWIFT_STORAGE:
         for container_name in self.swift_container_names:
             openstack_utils.create_swift_container(
                 container_name,
                 user=self.swift_openstack_user,
                 password=self.swift_openstack_password,
                 tenant=self.swift_openstack_tenant,
                 auth_url=self.swift_openstack_auth_url,
                 region=self.swift_openstack_region,
             )
         self.swift_provisioned = True
         self.save()
示例#2
0
 def provision_swift(self):
     """
     Create the Swift containers if necessary.
     """
     if self.storage_type == self.SWIFT_STORAGE:
         self.logger.warning(
             'SWIFT storage is not maintained and will be dropped in a future version.'
         )
         for container_name in self.swift_container_names:
             openstack_utils.create_swift_container(
                 container_name,
                 user=self.swift_openstack_user,
                 password=self.swift_openstack_password,
                 tenant=self.swift_openstack_tenant,
                 auth_url=self.swift_openstack_auth_url,
                 region=self.swift_openstack_region,
             )
         self.swift_provisioned = True
         self.save()
示例#3
0
 def test_create_swift_container(self, auth):
     """Test for create_swift_container function."""
     openstack_utils.create_swift_container(CONTAINER_NAME, **auth)
     self.service.post.assert_called_once_with(CONTAINER_NAME,
                                               options={'read_acl': '.r:*'})
     self.basic_checks(auth)