Skip to content

Commit

Permalink
Fix cmd time category
Browse files Browse the repository at this point in the history
Signed-off-by: zhanluxianshen <[email protected]>
  • Loading branch information
zhanluxianshen authored and MandssS committed Jul 1, 2024
1 parent d31cce9 commit be17985
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exec/time/time_travel.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (k *TravelTimeActionCommandSpec) LongDesc() string {
}

func (*TravelTimeActionCommandSpec) Categories() []string {
return []string{category.SystemProcess}
return []string{category.SystemTime}
}

type TravelTimeExecutor struct {
Expand Down Expand Up @@ -116,11 +116,11 @@ func (tte *TravelTimeExecutor) SetChannel(channel spec.Channel) {
}

func (tte *TravelTimeExecutor) stop(ctx context.Context) *spec.Response {
response := tte.channel.Run(ctx, "timedatectl", fmt.Sprintf(`set-ntp true`))
response := tte.channel.Run(ctx, "timedatectl", `set-ntp true`)
if !response.Success {
return response
}
return tte.channel.Run(ctx, "hwclock", fmt.Sprintf(`--hctosys`))
return tte.channel.Run(ctx, "hwclock", `--hctosys`)
}

func (tte *TravelTimeExecutor) start(ctx context.Context, timeOffsetStr string, disableNtp bool) *spec.Response {
Expand All @@ -132,7 +132,7 @@ func (tte *TravelTimeExecutor) start(ctx context.Context, timeOffsetStr string,
targetTime := time.Now().Add(duration).Format("01/02/2006 15:04:05")

if disableNtp {
response := tte.channel.Run(ctx, "timedatectl", fmt.Sprintf(`set-ntp false`))
response := tte.channel.Run(ctx, "timedatectl", `set-ntp false`)
if !response.Success {
return response
}
Expand Down

0 comments on commit be17985

Please sign in to comment.