eva-shell 0.2.32__tar.gz → 0.2.34__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eva-shell
3
- Version: 0.2.32
3
+ Version: 0.2.34
4
4
  Summary: EVA ICS v4 shell
5
5
  Home-page: https://github.com/eva-ics/eva4
6
6
  Author: Bohemia Automation / Altertech
@@ -1,3 +1,3 @@
1
- __version__ = '0.2.31'
1
+ __version__ = '0.2.34'
2
2
 
3
3
  DEFAULT_REPOSITORY_URL = 'https://pub.bma.ai/eva4'
@@ -279,6 +279,10 @@ def append_alarm_cli(root_sp):
279
279
  p.add_argument('--active', action='store_true', help='active only')
280
280
  p.add_argument('--inactive', action='store_true', help='inactive only')
281
281
  p.add_argument('--user', help='view user subscriptions')
282
+ p.add_argument('-z',
283
+ '--time-zone',
284
+ metavar='ZONE',
285
+ help='time zone (pytz, e.g. UTC or Europe/Prague)')
282
286
  p.add_argument('-a',
283
287
  '--alarm-svc',
284
288
  help=f'Alarm service (default: {DEFAULT_ALARM_SERVICE})',
@@ -716,6 +720,8 @@ def append_user_cli(root_sp):
716
720
  help=f'Authentication service (default: {DEFAULT_AUTH_SERVICE})',
717
721
  default=DEFAULT_AUTH_SERVICE).completer = ComplSvc('aaa')
718
722
 
723
+ p.add_argument('--acl', metavar='ACL', action='append', help=f'Uer ACL')
724
+
719
725
  p = sp.add_parser('destroy', help='destroy user')
720
726
  p.add_argument('i', metavar='user')
721
727
  p.add_argument(
@@ -787,7 +793,7 @@ def append_item_cli(root_sp):
787
793
  p.add_argument('--xopts',
788
794
  metavar='NAME=VALUE',
789
795
  help='Extra query options',
790
- nargs='*')
796
+ action='append')
791
797
 
792
798
  p = sp.add_parser('slog', help='item state log')
793
799
  p.add_argument('i', metavar='OID').completer = ComplOID()
@@ -502,7 +502,7 @@ class CLI:
502
502
  print(f'{len(users)} user(s) undeployed')
503
503
  print()
504
504
 
505
- def user_create(self, i, auth_svc):
505
+ def user_create(self, i, auth_svc, acl):
506
506
  import pwinput
507
507
  password = pwinput.pwinput()
508
508
  try:
@@ -515,7 +515,7 @@ class CLI:
515
515
  from hashlib import sha256
516
516
  pwhash = sha256(password.encode()).hexdigest()
517
517
  call_rpc('user.deploy',
518
- dict(users=[dict(login=i, password=pwhash)]),
518
+ dict(users=[dict(login=i, password=pwhash, acls=acl or [])]),
519
519
  target=auth_svc)
520
520
  ok()
521
521
 
@@ -946,8 +946,8 @@ class CLI:
946
946
  pass
947
947
  print_result(data,
948
948
  cols=[
949
- 'name', 'svc', 'type', 'online', 'timeout',
950
- 'ver', 'build'
949
+ 'name', 'svc', 'type', 'online', 'timeout', 'ver',
950
+ 'build'
951
951
  ])
952
952
  else:
953
953
  data = call_rpc('node.list', target=repl_svc)
@@ -1195,14 +1195,13 @@ class CLI:
1195
1195
  limit=limit,
1196
1196
  xopts=xopts_map),
1197
1197
  target=db_svc)
1198
- cols = []
1198
+ cols = [
1199
+ 't|n=time|f=time{}'.format(f':{time_zone}' if time_zone else '')
1200
+ ]
1199
1201
  if prop == 'status' or prop is None:
1200
1202
  cols += ['status']
1201
1203
  if prop == 'value' or prop is None:
1202
1204
  cols += ['value']
1203
- cols += [
1204
- 't|n=time|f=time{}'.format(f':{time_zone}' if time_zone else '')
1205
- ]
1206
1205
  print_result(data, cols=cols)
1207
1206
 
1208
1207
  def accounting_query(self, accounting_svc, time_start, time_end, time_zone,
@@ -1914,6 +1913,7 @@ class CLI:
1914
1913
  current=None,
1915
1914
  active=None,
1916
1915
  inactive=None,
1916
+ time_zone=None,
1917
1917
  user=None):
1918
1918
  flt = {}
1919
1919
  if node:
@@ -1939,7 +1939,9 @@ class CLI:
1939
1939
  print_result(data)
1940
1940
  else:
1941
1941
  cols = [
1942
- 'oid', 'node', 'level', 'group', 'id', 'current', 'description'
1942
+ 'oid', 'node', 'level', 'group', 'id', 'current',
1943
+ 't|n=time|f=time_sec{}'.format(
1944
+ f':{time_zone}' if time_zone else ''), 'description'
1943
1945
  ]
1944
1946
  if user:
1945
1947
  cols += ['subscriptions']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eva-shell
3
- Version: 0.2.32
3
+ Version: 0.2.34
4
4
  Summary: EVA ICS v4 shell
5
5
  Home-page: https://github.com/eva-ics/eva4
6
6
  Author: Bohemia Automation / Altertech
@@ -1,4 +1,4 @@
1
- __version__ = '0.2.32'
1
+ __version__ = '0.2.34'
2
2
 
3
3
  import setuptools
4
4
 
File without changes
File without changes
File without changes
File without changes