summaryrefslogtreecommitdiffstats
path: root/cli/objects/room.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/objects/room.py')
-rw-r--r--cli/objects/room.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/cli/objects/room.py b/cli/objects/room.py
index f22c843..da9a872 100644
--- a/cli/objects/room.py
+++ b/cli/objects/room.py
@@ -65,7 +65,7 @@ class OgRoom():
err = True
if err:
parser.print_help(file=sys.stderr)
- sys.exit(1)
+ return 1
payload = {
'name': parsed_args.name,
@@ -82,7 +82,10 @@ class OgRoom():
payload['folder_id'] = parsed_args.folder
if parsed_args.desc:
payload['location'] = parsed_args.desc
- rest.post('/room/add', payload=payload)
+ res = rest.post('/room/add', payload=payload)
+ if not res:
+ return 1
+ return 0
@staticmethod
def update_room(rest, args):
@@ -115,7 +118,7 @@ class OgRoom():
err = True
if err:
parser.print_help(file=sys.stderr)
- sys.exit(1)
+ return 1
payload = {
'id': parsed_args.id,
@@ -124,7 +127,10 @@ class OgRoom():
'gateway': parsed_args.gateway,
}
- rest.post('/room/update', payload=payload)
+ res = rest.post('/room/update', payload=payload)
+ if not res:
+ return 1
+ return 0
@staticmethod
def delete_room(rest, args):
@@ -136,5 +142,8 @@ class OgRoom():
help='room id in database')
parsed_args = parser.parse_args(args)
payload = {'id': parsed_args.id}
- rest.post('/room/delete', payload=payload)
+ res = rest.post('/room/delete', payload=payload)
+ if not res:
+ return 1
+ return 0