fix usage and listing
This commit is contained in:
+1
-1
@@ -96,8 +96,8 @@ def get_services(db):
|
|||||||
GROUP BY
|
GROUP BY
|
||||||
service.name;
|
service.name;
|
||||||
''')
|
''')
|
||||||
db.commit()
|
|
||||||
ret = {name: failures for (name, failures) in cur.fetchall()}
|
ret = {name: failures for (name, failures) in cur.fetchall()}
|
||||||
|
db.commit()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,11 @@ documentation for details.''')
|
|||||||
help='''Force clear for all services if service is
|
help='''Force clear for all services if service is
|
||||||
not specified''')
|
not specified''')
|
||||||
|
|
||||||
return parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
if not args.cmd:
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit(1)
|
||||||
|
return args
|
||||||
|
|
||||||
def cli():
|
def cli():
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
@@ -116,6 +120,7 @@ def cli():
|
|||||||
cli_list(args, db)
|
cli_list(args, db)
|
||||||
elif args.cmd == 'clear':
|
elif args.cmd == 'clear':
|
||||||
cli_clear(args, db)
|
cli_clear(args, db)
|
||||||
|
else:
|
||||||
|
|
||||||
sysalert.db.close(db)
|
sysalert.db.close(db)
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
Reference in New Issue
Block a user