Ejemplo n.º 1
0
    def run_copy(self):
        t = Template(self.args.template_from, user=self.args.username)

        try:
            t = self.cs.template_get(t)

        except ServiceException as e:
            logging.exception(e)
            return 1

        # reparse for template destination
        t.parse(self.args.template_to)

        try:
            res = self.cs.template_create(t)

        except ServiceException as e:
            logging.exception(e)
            return 1

        logging.info('Template copied.')
        return 0
Ejemplo n.º 2
0
    def run_copy(self):
        t = Template(self.args.template_from, user=self.args.username)

        try:
            t = self.cs.template_get(t)

        except ServiceException as e:
            logging.exception(e)
            return 1

        # reparse for template destination
        t.parse(self.args.template_to)

        try:
            res = self.cs.template_create(t)

        except ServiceException as e:
            logging.exception(e)
            return 1

        logging.info('Template copied.')
        return 0