- x = Owner.query().filter_by(owner_id=owner).first()
- if x == None:
- x = Owner(owner_id=owner)
-
- if opts.memtotal != None:
- total = int(opts.memtotal)
- if total == -1:
- x.ram_quota_total = None
- else:
- x.ram_quota_total = total
-
- if opts.memsingle != None:
- single = int(opts.memsingle)
- if single == -1:
- x.ram_quota_single = None
- else:
- x.ram_quota_single = single
-
- if opts.disktotal != None:
- total = int(opts.disktotal)
- if total == -1:
- x.disk_quota_total = None
- else:
- x.disk_quota_total = total
-
- if opts.disksingle != None:
- single = int(opts.disksingle)
- if single == -1:
- x.disk_quota_single = None
- else:
- x.disk_quota_single = single
-
- if opts.vmstotal != None:
- total = int(opts.vmstotal)
- if total == -1:
- x.vms_quota_total = None
- else:
- x.vms_quota_total = total