Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Make listing servers default command #2042

Merged
merged 1 commit into from
Jul 28, 2020
Merged

Conversation

ip1981
Copy link
Member

@ip1981 ip1981 commented Jul 2, 2020

[root@adm ~]# /bin/iml server 
+----+------------+--------------+------------------+
| Id | FQDN       | State        | Nids             |
+====+============+==============+==================+
| 1  | mds1.local | monitored    | 10.73.20.11@tcp0 |
+----+------------+--------------+------------------+
| 2  | mds2.local | monitored    | 10.73.20.12@tcp0 |
+----+------------+--------------+------------------+
| 3  | oss1.local | monitored    | 10.73.20.21@tcp0 |
+----+------------+--------------+------------------+
| 4  | oss2.local | monitored    | 10.73.20.22@tcp0 |
+----+------------+--------------+------------------+
| 5  | c1.local   | managed      | 10.0.2.15@tcp0   |
+----+------------+--------------+------------------+
| 6  | c2.local   | unconfigured |                  |
+----+------------+--------------+------------------+

[root@adm ~]# /bin/iml server list
+----+------------+--------------+------------------+
| Id | FQDN       | State        | Nids             |
+====+============+==============+==================+
| 1  | mds1.local | monitored    | 10.73.20.11@tcp0 |
+----+------------+--------------+------------------+
| 2  | mds2.local | monitored    | 10.73.20.12@tcp0 |
+----+------------+--------------+------------------+
| 3  | oss1.local | monitored    | 10.73.20.21@tcp0 |
+----+------------+--------------+------------------+
| 4  | oss2.local | monitored    | 10.73.20.22@tcp0 |
+----+------------+--------------+------------------+
| 5  | c1.local   | managed      | 10.0.2.15@tcp0   |
+----+------------+--------------+------------------+
| 6  | c2.local   | unconfigured |                  |
+----+------------+--------------+------------------+

Closes #2041.
Signed-off-by: Igor Pashev pashev.igor@gmail.com


This change is Reviewable

@ip1981 ip1981 requested a review from a team July 2, 2020 18:14
@ip1981 ip1981 self-assigned this Jul 2, 2020
mkpankov
mkpankov previously approved these changes Jul 14, 2020
Copy link
Contributor

@mkpankov mkpankov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ip1981)


iml-manager-cli/src/server.rs, line 544 at r1 (raw file):

pub async fn server_cli(command: Option<ServerCommand>) -> Result<(), ImlManagerCliError> {
    match command {
        None => list_server(DisplayType::Tabular).await?,

As an alternative: pull ServerCommand out of Option and match on it separately, break early if it's None. Avoids duplicated Some on all branches.

@ip1981
Copy link
Member Author

ip1981 commented Jul 14, 2020

As an alternative: pull ServerCommand out of Option and match on it separately, break early if it's None. Avoids duplicated Some on all branches.

Updated. Thanks!

That is:

    iml server [list]

Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
@ip1981 ip1981 force-pushed the ip1981/2041-cli-server-list branch from 3f49234 to e8b1093 Compare July 14, 2020 11:41
Copy link
Contributor

@mkpankov mkpankov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ip1981)

Copy link
Contributor

@nlinker nlinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle there are examples of such behaviour in the syntax command noun in e.g. git where git branch shows the current branch, git tag shows the list of tags.
Seems to be logical.

@jgrund jgrund merged commit d3b31e8 into master Jul 28, 2020
@jgrund jgrund deleted the ip1981/2041-cli-server-list branch July 28, 2020 13:18
beevans pushed a commit to beevans/integrated-manager-for-lustre that referenced this pull request Aug 6, 2020
That is:

    iml server [list]

Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants