def handleEdit(self, confInfo):

        km = AwsAccessKeyManager(KEY_NAMESPACE, KEY_OWNER, self.getSessionKey())
        key_id = self.callerArgs.data['key_id'][0]
        key_id = key_id and key_id.strip() or ''
        secret_key = self.callerArgs.data['secret_key'][0]
        secret_key = secret_key and secret_key.strip() or ''
        if not key_id and not secret_key:
            km.delete_accesskey()
        else:
            km.set_accesskey(key_id=key_id, secret_key=secret_key)
Пример #2
0
    def handleEdit(self, confInfo):
        # logger.info("get self info: " + str(self.__dict__))

        logger.info("get config info: " + str(self.callerArgs))

        # name = self.callerArgs.name
        name = self.callerArgs.data['fname'][0]
        key_id = self.callerArgs.data['key_id'][0]
        delete = self.callerArgs.data['delete'][0]

        logger.info("handle edit name {}, key id {}, delete: {}".format(
            name, key_id, delete))

        if delete != "1":
            return

        # delete key_id
        from taaws.aws_accesskeys import AwsAccessKeyManager
        km = AwsAccessKeyManager(KEY_NAMESPACE, KEY_OWNER,
                                 self.getSessionKey())
        km.delete_accesskey(name=name)