mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: cloud account/provider missing event logs for
delete/enable/disable/change_project
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/util/logclient"
|
||||
)
|
||||
|
||||
type SEnabledStatusStandaloneResourceBase struct {
|
||||
@@ -52,6 +53,7 @@ func (self *SEnabledStatusStandaloneResourceBase) PerformEnable(ctx context.Cont
|
||||
return nil, err
|
||||
}
|
||||
OpsLog.LogEvent(self, ACT_ENABLE, "", userCred)
|
||||
logclient.AddSimpleActionLog(self, logclient.ACT_ENABLE, nil, userCred, true)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
@@ -71,6 +73,7 @@ func (self *SEnabledStatusStandaloneResourceBase) PerformDisable(ctx context.Con
|
||||
return nil, err
|
||||
}
|
||||
OpsLog.LogEvent(self, ACT_DISABLE, "", userCred)
|
||||
logclient.AddSimpleActionLog(self, logclient.ACT_DISABLE, nil, userCred, true)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -269,6 +269,18 @@ func (model *SVirtualResourceBase) PerformChangeOwner(ctx context.Context, userC
|
||||
return nil, err
|
||||
}
|
||||
OpsLog.SyncOwner(model, former, userCred)
|
||||
notes := struct {
|
||||
OldProjectId string
|
||||
OldProject string
|
||||
NewProjectId string
|
||||
NewProject string
|
||||
}{
|
||||
OldProjectId: former.Id,
|
||||
OldProject: former.Name,
|
||||
NewProjectId: tobj.GetId(),
|
||||
NewProject: tobj.GetName(),
|
||||
}
|
||||
logclient.AddActionLogWithContext(ctx, model, logclient.ACT_CHANGE_OWNER, notes, userCred, true)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user