tools/qvm-features: fix domain argument handling
It's args.domains[0], not args.vm.
This commit is contained in:
		
							parent
							
								
									c3fc4062d8
								
							
						
					
					
						commit
						98edc9779c
					
				| @ -58,21 +58,22 @@ def main(args=None): | |||||||
|     ''' |     ''' | ||||||
| 
 | 
 | ||||||
|     args = parser.parse_args(args) |     args = parser.parse_args(args) | ||||||
|  |     vm = args.domains[0] | ||||||
| 
 | 
 | ||||||
|     if args.request: |     if args.request: | ||||||
|         # Request mode: instead of setting the features directly, |         # Request mode: instead of setting the features directly, | ||||||
|         # let the extensions handle them first. |         # let the extensions handle them first. | ||||||
|         args.vm.fire_event('feature-request', untrusted_features=args.features) |         vm.fire_event('feature-request', untrusted_features=args.features) | ||||||
|         return 0 |         return 0 | ||||||
| 
 | 
 | ||||||
|     if args.feature is None: |     if args.feature is None: | ||||||
|         if args.delete: |         if args.delete: | ||||||
|             parser.error('--unset requires a feature') |             parser.error('--unset requires a feature') | ||||||
| 
 | 
 | ||||||
|         width = max(len(feature) for feature in args.vm.features) |         width = max(len(feature) for feature in vm.features) | ||||||
|         for feature in sorted(args.vm.features): |         for feature in sorted(vm.features): | ||||||
|             print('{name:{width}s}  {value}'.format( |             print('{name:{width}s}  {value}'.format( | ||||||
|                 name=feature, value=args.vm.features[feature], width=width)) |                 name=feature, value=vm.features[feature], width=width)) | ||||||
| 
 | 
 | ||||||
|         return 0 |         return 0 | ||||||
| 
 | 
 | ||||||
| @ -80,7 +81,7 @@ def main(args=None): | |||||||
|         if args.value is not None: |         if args.value is not None: | ||||||
|             parser.error('cannot both set and unset a value') |             parser.error('cannot both set and unset a value') | ||||||
|         try: |         try: | ||||||
|             del args.vm.features[args.feature] |             del vm.features[args.feature] | ||||||
|             args.app.save() |             args.app.save() | ||||||
|         except KeyError: |         except KeyError: | ||||||
|             pass |             pass | ||||||
| @ -88,12 +89,12 @@ def main(args=None): | |||||||
| 
 | 
 | ||||||
|     if args.value is None: |     if args.value is None: | ||||||
|         try: |         try: | ||||||
|             print(args.vm.features[args.feature]) |             print(vm.features[args.feature]) | ||||||
|             return 0 |             return 0 | ||||||
|         except KeyError: |         except KeyError: | ||||||
|             return 1 |             return 1 | ||||||
| 
 | 
 | ||||||
|     args.vm.features[args.feature] = args.value |     vm.features[args.feature] = args.value | ||||||
|     args.app.save() |     args.app.save() | ||||||
|     return 0 |     return 0 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user