def _register_action_alias(self, pack, action_alias):
        action_alias_db = self._get_action_alias_db(pack=pack, action_alias=action_alias)

        try:
            action_alias_db.id = ActionAlias.get_by_name(action_alias_db.name).id
        except __HOLE__:
            LOG.debug('ActionAlias %s not found. Creating new one.', action_alias)

        try:
            action_alias_db = ActionAlias.add_or_update(action_alias_db)
            extra = {'action_alias_db': action_alias_db}
            LOG.audit('Action alias updated. Action alias %s from %s.', action_alias_db,
                      action_alias, extra=extra)
        except Exception:
            LOG.exception('Failed to create action alias %s.', action_alias_db.name)
            raise
dataset/ETHPy150Open StackStorm/st2/st2common/st2common/bootstrap/aliasesregistrar.py/AliasesRegistrar._register_action_alias