Esempio n. 1
0
 def provision_swift(self):
     """
     Create the Swift containers if necessary.
     """
     if settings.SWIFT_ENABLE and not self.swift_provisioned:
         for container_name in self.swift_container_names:
             openstack.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()
Esempio n. 2
0
 def provision_swift(self):
     """
     Create the Swift containers if necessary.
     """
     if settings.SWIFT_ENABLE and not self.swift_provisioned:
         for container_name in self.swift_container_names:
             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()
Esempio n. 3
0
 def test_create_swift_container(self, auth):
     """Test for create_swift_container function."""
     openstack.create_swift_container(CONTAINER_NAME, **auth)
     self.service.post.assert_called_once_with(CONTAINER_NAME, options={'read_acl': '.r:*'})
     self.basic_checks(auth)