Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vlans are not correctly dehydrated #145

Closed
lutostag opened this issue Nov 29, 2017 · 0 comments
Closed

vlans are not correctly dehydrated #145

lutostag opened this issue Nov 29, 2017 · 0 comments

Comments

@lutostag
Copy link
Contributor

In [2]: from maas.client import connect

In [3]: maas = connect('http://10.48.0.230:5240/MAAS', apikey='***')                        

In [4]: other = maas.subnets.list()[0] 

In [5]: other.vlan = other.vlan        

In [6]: other.save()                   
---------------------------------------------------------------------------    
AssertionError                            Traceback (most recent call last)    
<ipython-input-6-01f21911bae3> in <module>()                                   
----> 1 other.save()                   

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/utils/async.py in wrapper(*args, **kwargs)                                                          
     47         if not eventloop.is_running():                                 
     48             while isawaitable(result):                                 
---> 49                 result = eventloop.run_until_complete(result)          
     50         return result          
     51                                

/usr/lib/python3.6/asyncio/base_events.py in run_until_complete(self, future)  
    465             raise RuntimeError('Event loop stopped before Future completed.')                                                                          
    466                                
--> 467         return future.result() 
    468                                
    469     def stop(self):            

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/viscera/__init__.py in save(self)                                                                   
    480                     for key in self._handler.params                    
    481                 })             
--> 482                 self._data = await self._handler.update(**update_data) 
    483         else:                  
    484             raise AttributeError(                                      

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/bones/__init__.py in __call__(self, **data)                                                         
    300             if key.startswith('_'):                                    
    301                 data[key[1:]] = data.pop(key)                          
--> 302         response = await self.bind(**params).call(**data)              
    303         return response.data   
    304                                

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/bones/__init__.py in call(self, **data)                                                             
    388         :param data: Data to pass in the *body* of the request.        
    389         """                    
--> 390         uri, body, headers = self.prepare(data)                        
    391         return self.dispatch(uri, body, headers)                       
    392                                

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/bones/__init__.py in prepare(self, data)                                                            
    418         # Bundle things up ready to throw over the wire.               
    419         uri, body, headers = utils.prepare_payload(                    
--> 420             self.action.op, self.action.method, self.uri, data)        
    421                                
    422         # Headers are returned as a list, but they must be a dict for  

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/utils/__init__.py in prepare_payload(op, method, uri, data)                                         
    109         # Even if data is empty, construct a multipart request body. Piston                                                                            
    110         # (server-side) sets `request.data` to `None` if there's no payload.                                                                           
--> 111         message = build_multipart_message(data)                        
    112         headers, body = encode_multipart_message(message)              
    113                                

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/utils/multipart.py in build_multipart_message(data)                                                 
    122     message = MIMEMultipart("form-data")                               
    123     for name, content in data: 
--> 124         for payload in make_payloads(name, content):                   
    125             message.attach(payload)                                    
    126     return message             

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/utils/multipart.py in make_payloads(name, content)                                                  
    112     elif isinstance(content, Iterable):                                
    113         for part in content:   
--> 114             for payload in make_payloads(name, part):                  
    115                 yield payload  
    116     else:                      

~/.virtualenvs/mmm/lib/python3.6/site-packages/maas/client/utils/multipart.py in make_payloads(name, content)                                                  
    116     else:                      
    117         raise AssertionError(  
--> 118             "%r is unrecognised: %r" % (name, content))                
    119                                
    120                                

AssertionError: 'vlan' is unrecognised: <Fabric id=0 (unloaded)>               

In [7]: 

This is just a small repro. I am obviously trying to set it to a different vlan, this is just the most concise repro I could get.

blakerouse pushed a commit to blakerouse/python-libmaas that referenced this issue Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant