Example #1
0
    def ck_cdn(self, secrets):
        if self.client.rax_id:
            rax_id = self.client.rax_id
            p_okg("client.rax_id: {}".format(rax_id))
        else:
            p_warn("client.rax_id not set.")
            return

        if self.client.bucket_id:
            bucket_id = self.client.bucket_id
            p_okg("client.bucket_id: {}".format(bucket_id))
        else:
            p_fail("client.bucket_id not set.")

        print("checking for valid bucket...")
        cf = rax_uploader.auth(rax_id)
        containers = cf.get_all_containers()
        container_names = [container.name for container in containers]
        print("container_names", container_names)
        if bucket_id in container_names:
            p_okg('"{}" found.'.format(bucket_id))
        else:
            p_fail('"{}" not found.'.format(bucket_id))

        # not sure what to do with this...
        # container = cf.get_container(bucket_id)
        return
Example #2
0
    def ck_cdn(self, secrets):
        if self.client.rax_id:
            rax_id = self.client.rax_id
            p_okg("client.rax_id: {}".format(rax_id))
        else:
            p_warn("client.rax_id not set.")
            return

        if self.client.bucket_id:
            bucket_id = self.client.bucket_id
            p_okg("client.bucket_id: {}".format(bucket_id))
        else:
            p_fail("client.bucket_id not set.")

        print("checking for valid bucket...")
        cf = rax_uploader.auth(rax_id)
        containers = cf.get_all_containers()
        container_names = [container.name for container in containers]
        print("container_names", container_names)
        if bucket_id in container_names:
            p_okg('"{}" found.'.format(bucket_id))
        else:
            p_fail('"{}" not found.'.format(bucket_id))

        # not sure what to do with this...
        # container = cf.get_container(bucket_id)
        return
Example #3
0
    def init_rax(self, show):
         user = show.client.rax_id
         bucket_id = show.client.bucket_id

         cf = rax_uploader.auth(user)

         print "cf.get_all_containers", cf.get_all_containers()
         
         container = cf.get_container(bucket_id)
         objects = container.get_objects()
         print "loading names..."
         self.names = {o.name for o in objects}
         print "loaded."
Example #4
0
    def init_rax(self, show):
        # user = self.show.client.rax_id
        # bucket_id = self.show.client.bucket_id

        # user = self.options.cloud_user
        # bucket_id = self.options.rax_bucket
        user = show.client.rax_id
        bucket_id = show.client.bucket_id

        cf = rax_uploader.auth(user)

        print "cf.get_all_containers", cf.get_all_containers()

        container = cf.get_container(bucket_id)
        objects = container.get_objects()
        print "loading names..."
        self.names = {o.name for o in objects}
        print "loaded."