Fix storage initialisation
This commit is contained in:
		
							parent
							
								
									1f302fb776
								
							
						
					
					
						commit
						3cb5f031a9
					
				@ -460,10 +460,10 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
 | 
				
			|||||||
        super(QubesVM, self).__init__(app, xml, **kwargs)
 | 
					        super(QubesVM, self).__init__(app, xml, **kwargs)
 | 
				
			||||||
        self.volumes = {}
 | 
					        self.volumes = {}
 | 
				
			||||||
        self.storage = None
 | 
					        self.storage = None
 | 
				
			||||||
        self.volume_config = {}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if volume_config is None:
 | 
					        if volume_config is None:
 | 
				
			||||||
            volume_config = {}
 | 
					            volume_config = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if hasattr(self, 'volume_config'):
 | 
					        if hasattr(self, 'volume_config'):
 | 
				
			||||||
            if xml is not None:
 | 
					            if xml is not None:
 | 
				
			||||||
                for node in xml.xpath('volume-config/volume'):
 | 
					                for node in xml.xpath('volume-config/volume'):
 | 
				
			||||||
@ -475,6 +475,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
 | 
				
			|||||||
            for name, conf in volume_config.items():
 | 
					            for name, conf in volume_config.items():
 | 
				
			||||||
                for key, value in conf.items():
 | 
					                for key, value in conf.items():
 | 
				
			||||||
                    self.volume_config[name][key] = value
 | 
					                    self.volume_config[name][key] = value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        elif volume_config:
 | 
					        elif volume_config:
 | 
				
			||||||
            raise TypeError(
 | 
					            raise TypeError(
 | 
				
			||||||
                'volume_config specified, but {} did not expect that.'.format(
 | 
					                'volume_config specified, but {} did not expect that.'.format(
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user