mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 14:54:24 +02:00
fix license show panics
This commit is contained in:
@@ -39,18 +39,28 @@ func LicenseShow(conf *cfg.Config) error {
|
|||||||
lic := res.License
|
lic := res.License
|
||||||
|
|
||||||
var maxnodes = "infinite"
|
var maxnodes = "infinite"
|
||||||
|
var maxunits = "infinite"
|
||||||
|
var expire = "never"
|
||||||
|
|
||||||
if lic.MaxNodes != nil {
|
if lic.MaxNodes != nil {
|
||||||
maxnodes = fmt.Sprintf("%d", *lic.MaxNodes)
|
maxnodes = fmt.Sprintf("%d", *lic.MaxNodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if lic.ExpiryDate != nil {
|
||||||
|
expire = lic.ExpiryDate.(string)
|
||||||
|
}
|
||||||
|
|
||||||
|
if lic.MaxResourceUnits != nil {
|
||||||
|
maxunits = fmt.Sprintf("%d", *lic.MaxResourceUnits)
|
||||||
|
}
|
||||||
|
|
||||||
table.Entries = [][]string{
|
table.Entries = [][]string{
|
||||||
{"UID", lic.Uid},
|
{"UID", lic.Uid},
|
||||||
{"Issued to", lic.IssuedTo},
|
{"Issued to", lic.IssuedTo},
|
||||||
{"Expires", lic.ExpiryDate.(string)},
|
{"Expires", expire},
|
||||||
{"Issued", lic.IssueDate.(string)},
|
{"Issued", lic.IssueDate.(string)},
|
||||||
{"Max nodes", maxnodes},
|
{"Max nodes", maxnodes},
|
||||||
{"Max resource units", fmt.Sprintf("%d", *lic.MaxResourceUnits)},
|
{"Max resource units", maxunits},
|
||||||
{"Type", lic.Type.Name},
|
{"Type", lic.Type.Name},
|
||||||
{"Status", lic.Status.Name},
|
{"Status", lic.Status.Name},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user