Skip to content

Commit

Permalink
--reservation for inventory show
Browse files Browse the repository at this point in the history
  • Loading branch information
Michio Honda committed Dec 15, 2020
1 parent 0c4cef4 commit 719da0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tm.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(self, argv, dbfile=DBFILE, tftpboot=TFTPBOOT, test=False):
self.ipmi_addr_off = 100
self.addrs = ('mac', 'ip', 'ipmiaddr', 'ipmipass')
self.devices = ('disk', 'nic', 'accel')
self.reservations = ('user', 'expire', 'email')
self.curuser = getpass.getuser()
self.test = test
self.kernelversion = KERNELVERSION
Expand Down Expand Up @@ -255,6 +256,8 @@ def inventory(self, argv):
help='management addresses')
p.add_argument('--devices', action='store_true',
help='I/O peripherals')
p.add_argument('--reservations', action='store_true',
help='reservations')
p.set_defaults(func=cmd)
delete = subparsers.add_parser('delete')
delete.add_argument('node', type=str, help=namehelp)
Expand Down Expand Up @@ -344,7 +347,7 @@ def inventory(self, argv):
cls.remove(r)
cls.insert(i, r)
if args.func == 'show':
for a in ('addrs', 'devices'):
for a in ('addrs', 'devices', 'reservations'):
if not getattr(args, a):
cls = [c for c in cls if c not in getattr(self, a)]
self.pr_msg(df.reindex(columns=cls))
Expand Down

0 comments on commit 719da0d

Please sign in to comment.