Skip to content

Commit

Permalink
Rename (rebrand?) ldmc -> lhsm
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Read committed Dec 22, 2016
1 parent beb393a commit eb9a397
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 172 deletions.
330 changes: 163 additions & 167 deletions cmd/ldmc/hsm.go → cmd/lhsm/hsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,191 +25,187 @@ import (
func init() {
hsmStateFlags := strings.Join(hsm.GetStateFlagNames(), ",")

hsmCommand := cli.Command{
Name: "hsm",
Usage: "HSM-related data movement actions",
Subcommands: []cli.Command{
{
Name: "archive",
Usage: "Initiate HSM archive of specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.IntFlag{
Name: "id, i",
Usage: "Numeric ID of archive backend",
},
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
hsmCommands := []cli.Command{
{
Name: "archive",
Usage: "Initiate HSM archive of specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.IntFlag{
Name: "id, i",
Usage: "Numeric ID of archive backend",
},
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestArchive),
},
{
Name: "release",
Usage: "Release local data of HSM-archived paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestArchive),
},
{
Name: "release",
Usage: "Release local data of HSM-archived paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestRelease),
},
{
Name: "restore",
Usage: "Explicitly restore local data of HSM-archived paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestRelease),
},
{
Name: "restore",
Usage: "Explicitly restore local data of HSM-archived paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestRestore),
},
{
Name: "remove",
Usage: "Remove HSM-archived data of specified paths (local data is not removed)",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestRestore),
},
{
Name: "remove",
Usage: "Remove HSM-archived data of specified paths (local data is not removed)",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestRemove),
},
{
Name: "cancel",
Usage: "Cancel HSM operations being performed on specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestRemove),
},
{
Name: "cancel",
Usage: "Cancel HSM operations being performed on specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmRequestAction(hsm.RequestCancel),
},
{
Name: "set",
Usage: "Set HSM flags or archive ID for specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
cli.IntFlag{
Name: "id, i",
Usage: "Numeric ID of archive backend",
},
cli.StringSliceFlag{
Name: "flag, f",
Usage: fmt.Sprintf("HSM flag to set (%s)", hsmStateFlags),
Value: &cli.StringSlice{},
},
cli.StringSliceFlag{
Name: "clear, F",
Usage: fmt.Sprintf("HSM flag to clear (%s)", hsmStateFlags),
Value: &cli.StringSlice{},
},
Action: hsmRequestAction(hsm.RequestCancel),
},
{
Name: "set",
Usage: "Set HSM flags or archive ID for specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
cli.IntFlag{
Name: "id, i",
Usage: "Numeric ID of archive backend",
},
cli.StringSliceFlag{
Name: "flag, f",
Usage: fmt.Sprintf("HSM flag to set (%s)", hsmStateFlags),
Value: &cli.StringSlice{},
},
cli.StringSliceFlag{
Name: "clear, F",
Usage: fmt.Sprintf("HSM flag to clear (%s)", hsmStateFlags),
Value: &cli.StringSlice{},
},
Action: hsmSetAction,
},
{
Name: "status",
Usage: "Display HSM status for specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "action, a",
Usage: "Include current HSM action",
},
cli.BoolFlag{
Name: "hide-path, H",
Usage: "Hide pathname in output",
},
cli.BoolFlag{
Name: "long, l",
Usage: "Show long-form states",
},
cli.BoolFlag{
Name: "progress, p",
Usage: "Show copy progress for archive/restore actions",
},
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmSetAction,
},
{
Name: "status",
Usage: "Display HSM status for specified paths",
ArgsUsage: "[path [path...]]",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "action, a",
Usage: "Include current HSM action",
},
cli.BoolFlag{
Name: "hide-path, H",
Usage: "Hide pathname in output",
},
cli.BoolFlag{
Name: "long, l",
Usage: "Show long-form states",
},
cli.BoolFlag{
Name: "progress, p",
Usage: "Show copy progress for archive/restore actions",
},
cli.BoolFlag{
Name: "null, 0",
Usage: "Null-separated paths are read from stdin (e.g. piped from find -print0)",
},
Action: hsmStatusAction,
},
{
Name: "import",
Usage: "Import an HSM-backed file.",
ArgsUsage: "path",
Flags: []cli.Flag{
cli.UintFlag{
Name: "id, i",
Usage: "Numeric ID of archive backend",
},
cli.StringFlag{
Name: "uuid",
Usage: "File's UUID",
},
cli.StringFlag{
Name: "hash",
Usage: "Checksum hash value",
},
cli.StringFlag{
Name: "uid",
Usage: "Owner uid",
},
cli.StringFlag{
Name: "gid",
Usage: "Owner gid",
},
cli.Int64Flag{
Name: "size",
Usage: "Size of file in bytes",
},
cli.UintFlag{
Name: "mode",
Value: 0644,
Usage: "File mode",
},
cli.StringFlag{
Name: "timefmt",
Value: "2006-01-02 15:04:05.999999999 -0700",
Usage: "Format for time stamp see golang time.Parse documentation",
},
cli.StringFlag{
Name: "mtime",
Usage: "Modification time (default: current time)",
},
cli.StringFlag{
Name: "atime",
Usage: "Last access time (default: set to mtime)",
},
cli.IntFlag{
Name: "stripe_count",
Value: 1,
Usage: "Set number of stripes in file",
},
cli.IntFlag{
Name: "stripe_size",
Value: 1 << 20,
Usage: "Set stripe size in bytes",
},
Action: hsmStatusAction,
},
{
Name: "import",
Usage: "Import an HSM-backed file.",
ArgsUsage: "path",
Flags: []cli.Flag{
cli.UintFlag{
Name: "id, i",
Usage: "Numeric ID of archive backend",
},
cli.StringFlag{
Name: "uuid",
Usage: "File's UUID",
},
cli.StringFlag{
Name: "hash",
Usage: "Checksum hash value",
},
cli.StringFlag{
Name: "uid",
Usage: "Owner uid",
},
cli.StringFlag{
Name: "gid",
Usage: "Owner gid",
},
cli.Int64Flag{
Name: "size",
Usage: "Size of file in bytes",
},
cli.UintFlag{
Name: "mode",
Value: 0644,
Usage: "File mode",
},
cli.StringFlag{
Name: "timefmt",
Value: "2006-01-02 15:04:05.999999999 -0700",
Usage: "Format for time stamp see golang time.Parse documentation",
},
cli.StringFlag{
Name: "mtime",
Usage: "Modification time (default: current time)",
},
cli.StringFlag{
Name: "atime",
Usage: "Last access time (default: set to mtime)",
},
cli.IntFlag{
Name: "stripe_count",
Value: 1,
Usage: "Set number of stripes in file",
},
cli.IntFlag{
Name: "stripe_size",
Value: 1 << 20,
Usage: "Set stripe size in bytes",
},
Action: hsmImportAction,
},
Action: hsmImportAction,
},
}
commands = append(commands, hsmCommand)
commands = append(commands, hsmCommands...)
}

func getFilePaths(c *cli.Context) ([]string, error) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/ldmc/main.go → cmd/lhsm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var version string // Set by build environment

func main() {
app := cli.NewApp()
app.Usage = "Data Movement Control for Lustre* software"
app.Usage = "HSM-related actions"
app.Commands = commands
app.Version = version
app.Authors = []cli.Author{
Expand Down
8 changes: 4 additions & 4 deletions packaging/rpm/lemur.spec
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ installations.

# TODO: This has to be GPL because it links against liblustreapi. Can we
# fix that?
%package -n ldmc
%package -n lhsm
Summary: Lustre HSM Tools - Data Movement Control
License: GPLv2
Requires: lustre-client >= %{?MIN_LUSTRE_VERSION}%{?!MIN_LUSTRE_VERSION:2.6.0}

%description -n ldmc
%description -n lhsm
CLI for Lustre data movement control.

%prep
Expand Down Expand Up @@ -136,6 +136,6 @@ mv %{buildroot}/%{_bindir}/lhsmd %{buildroot}/%{_sbindir}
%{_libexecdir}/%{pkg_prefix}-testing/%{pkg_prefix}-uat-runner
%{_datarootdir}/%{pkg_prefix}/test/features/*.feature

%files -n ldmc
%files -n lhsm
%defattr(-,root,root)
%{_bindir}/ldmc
%{_bindir}/lhsm

0 comments on commit eb9a397

Please sign in to comment.