Changing :
def _get_updated_comment(self, vol_name, **values): vol = self.client.getVolume(vol_name) comment = json.loads(vol['comment']) if vol['comment'] else {} comment.update(values)
to
def _get_updated_comment(self, vol_name, **values): vol = self.client.getVolume(vol_name) comment = json.loads(vol['comment']) if vol.get('comment') else {} comment.update(values)
resolves the issue.
Changing :
def _get_updated_ comment( self, vol_name, **values): getVolume( vol_name) vol['comment' ]) if vol['comment'] else {}
comment. update( values)
vol = self.client.
comment = json.loads(
to
def _get_updated_ comment( self, vol_name, **values): getVolume( vol_name) vol['comment' ]) if vol.get('comment') else {}
comment. update( values)
vol = self.client.
comment = json.loads(
resolves the issue.