forked from TrueCloudLab/frostfs-node
[#1382] ir: Replace deprecated methods
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d4be2f20d4
commit
a603d14d08
6 changed files with 10 additions and 10 deletions
|
@ -56,11 +56,11 @@ func (x *NetMapCandidateValidator) SetNetworkSettings(netSettings NetworkSetting
|
|||
//
|
||||
// See also netmap.NodeInfo.IsOnline/SetOnline and other similar methods.
|
||||
func (x *NetMapCandidateValidator) VerifyAndUpdate(node *netmap.NodeInfo) error {
|
||||
if node.IsOnline() {
|
||||
if node.Status().IsOnline() {
|
||||
return nil
|
||||
}
|
||||
|
||||
if node.IsMaintenance() {
|
||||
if node.Status().IsMaintenance() {
|
||||
return x.netSettings.MaintenanceModeAllowed()
|
||||
}
|
||||
|
||||
|
|
|
@ -41,22 +41,22 @@ func TestValidator_VerifyAndUpdate(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "ONLINE",
|
||||
preparer: (*netmap.NodeInfo).SetOnline,
|
||||
preparer: func(ni *netmap.NodeInfo) { ni.SetStatus(netmap.Online) },
|
||||
valid: true,
|
||||
},
|
||||
{
|
||||
name: "OFFLINE",
|
||||
preparer: (*netmap.NodeInfo).SetOffline,
|
||||
preparer: func(ni *netmap.NodeInfo) { ni.SetStatus(netmap.Offline) },
|
||||
valid: false,
|
||||
},
|
||||
{
|
||||
name: "MAINTENANCE/allowed",
|
||||
preparer: (*netmap.NodeInfo).SetMaintenance,
|
||||
preparer: func(ni *netmap.NodeInfo) { ni.SetStatus(netmap.Maintenance) },
|
||||
valid: true,
|
||||
},
|
||||
{
|
||||
name: "MAINTENANCE/disallowed",
|
||||
preparer: (*netmap.NodeInfo).SetMaintenance,
|
||||
preparer: func(ni *netmap.NodeInfo) { ni.SetStatus(netmap.Maintenance) },
|
||||
valid: false,
|
||||
validatorPreparer: func(v *state.NetMapCandidateValidator) {
|
||||
var s testNetworkSettings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue