Skip to content

Commit

Permalink
Merge pull request #8320 from filecoin-project/fix/listsectors-primary
Browse files Browse the repository at this point in the history
fix: storage cli: Output primary sector status correctly
  • Loading branch information
magik6k authored Mar 15, 2022
2 parents c3cadcb + c6bda0e commit 913cab2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/lotus-miner/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ var storageListSectorsCmd = &cli.Command{
ft storiface.SectorFileType
urls string

primary, seal, store bool
primary, copy, main, seal, store bool

state api.SectorState
}
Expand Down Expand Up @@ -626,8 +626,11 @@ var storageListSectorsCmd = &cli.Command{
urls: strings.Join(info.URLs, ";"),

primary: info.Primary,
seal: info.CanSeal,
store: info.CanStore,
copy: !info.Primary && len(si) > 1,
main: !info.Primary && len(si) == 1, // only copy, but not primary

seal: info.CanSeal,
store: info.CanStore,

state: st.State,
})
Expand Down Expand Up @@ -680,7 +683,7 @@ var storageListSectorsCmd = &cli.Command{
"Sector": e.id,
"Type": e.ft.String(),
"State": color.New(stateOrder[sealing.SectorState(e.state)].col).Sprint(e.state),
"Primary": maybeStr(e.seal, color.FgGreen, "primary"),
"Primary": maybeStr(e.primary, color.FgGreen, "primary") + maybeStr(e.copy, color.FgBlue, "copy") + maybeStr(e.main, color.FgRed, "main"),
"Path use": maybeStr(e.seal, color.FgMagenta, "seal ") + maybeStr(e.store, color.FgCyan, "store"),
"URLs": e.urls,
}
Expand Down

0 comments on commit 913cab2

Please sign in to comment.