def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) log("--------------------------------------------") log("Container %s info before enabling CDN:" % self.container_name ) self.show(self.container_name) if self.enable_cdn(self.container_name) : log("--------------------------------------------") log("Container info after enabling CDN:") self.container=self.show(self.container_name) log("--------------------------------------------") log("Example files from the container %s" % self.container.name) objects=self.container.get_objects() if objects : # print example 2 files from the container for index in [ i for i in range(0, len(objects)) if i < 2 ] : cf_file=objects[index] log("============================================") self.show_file_info(cf_file) else: log("there are not files in the container")
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) log("Creating new DNS zone %s" % self.domain_name) self.domain=self.dns.create(name=self.domain_name, emailAddress="*****@*****.**", ttl=300, comment="challenge9 domain") log("Creating cloud server ...(please wait the build can take a while)") self.server=self.cs.servers.create(name=self.fqdn_name, flavor=self.flavor_id, image=self.image_id) wait = WaitingForTask(self.check_cs_build, self.server) if wait.wait_for_tasks() == False: log("Cloud server build failed, deleting created objects") self.server.delete() self.domain.delete() sys.exit(-1) # get all public IPs net = [ i["addr"] for i in self.server.addresses["public"] ] self.net = utils.get_ipv4net(net) cname_rec = {"type": "A", "name": self.fqdn_name, "data": self.net, "ttl": 300, "comment": "challenge9 rec"} self.recs = self.domain.add_record(cname_rec) log("DNS zone %s has been udpated and a new A record created" % (self.domain_name)) log("rec A: %s -> %s" % (self.fqdn_name, self.net))
def run(self): debug("run start") ChallengeBase.run(self) if self.check(args) is False: self.usage() sys.exit(-1) log("Uploading directory %s to container %s" % (self.path, self.container)) self.upload_dir(self.path) self.wait_for_upload()
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) log("Creating container %s and uploading small %s file." % (self.container_name, self.index_name) ) self.set_container() self.set_dns() self.show()
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) if self.create_domain(self.domain_name) == False: self.usage() sys.exit(-1) if self.create_record(self.domain_name, self.ip_str) : self.show()
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) log("Creating instance %s" % self.db_instance_name) self.create_db_instance(self.db_instance_name) log("Waiting for the instance to be built ...") self.wait_for_instance_build() log("Instance is created on host %s" % self.db_instance.hostname) log("Creating databases %s under the instance %s" % (self.dbs, self.db_instance_name)) self.create_dbs() log("Creating users %s" % (self.db_users)) self.create_users()
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) self.check() log("Building %d cloud servers" % self.cs_count) self.build_cs() log("Building and configuring lb ...") self.build_lb() log("Building and configuring dns domain ...") self.build_dns() self.show()
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) log("Building %d cloud servers" % self.cs_count) mycs=CloudServers(self.cs_count, "challenge7") self.servers = mycs.get_servers() log("Building and configuring lb ...") self.build_lb() wait = WaitingForTask(self.check_lb, [self.lb_name], sleep_time=5, max_timeout=1) if wait.wait_for_tasks() == False: log("Aborting as the build of lb is taking too long; created lb and cloud servers will be deleted") self.delete_all() sys.exit(-1) self.show()
def run(self): debug("run start") ChallengeBase.run(self) if self.check() is False: self.usage() sys.exit(-1) log("Building %d cloud servers" % self.cs_count) files={'/root/.ssh/authorized_keys': self.ssh_public_key } mycs=CloudServers(self.cs_count, self.server_prefix, image=self.image_id, flavor=self.flavor_id, files=files ) self.servers = mycs.get_servers() log("Building and configuring lb ...") self.build_lb() log("Building and configuring dns domain ...") self.build_dns() log("Backuping files to cloud files ...") self.backup_to_cloud_files() self.show()