Skip to content

Commit

Permalink
Allow docker driver configs to be updated properly. Closes #667.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilavarasi12 committed Nov 16, 2017
1 parent d3910da commit df8625a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions pebbles/static/js/controllers/DashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ app.controller('ModalDestroyInstanceController', function($scope, $modalInstance
app.controller('DriverConfigController', ['$scope', 'Restangular',
function ($scope, Restangular) {

$scope.panel_open = false;
$scope.panel_open = true;

$scope.toggleStatusOpen = function() {
if ($scope.panel_open){
Expand Down Expand Up @@ -395,11 +395,7 @@ app.controller('DriverConfigController', ['$scope', 'Restangular',
}).then( function(){
fetchDriverConfigs();
}, function(response){
if (response.status == 409) {
$.notify({title: 'Outdated Config Found:', message: 'Loading the latest config'}, {type: 'danger'});
} else {
console.log('error while updating the driver specific variable');
}
console.log('error while updating the driver specific variable');
fetchDriverConfigs();
});
};
Expand Down
8 changes: 4 additions & 4 deletions pebbles/views/namespaced_keyvalues.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def put(self, namespace, key):
logging.warn("no NamespacedKeyValue object found for namespace %s with key %s" % (namespace, key))
abort(404)
# Check for concurrency
namespaced_keyvalue_updated = namespaced_keyvalue_query.filter_by(updated_ts=updated_version_ts).first()
if not namespaced_keyvalue_updated:
logging.warn("trying to modify an outdated record")
return {'error': 'CONCURRENT_MODIFICATION_EXCEPTION'}, 409
#namespaced_keyvalue_updated = namespaced_keyvalue_query.filter_by(updated_ts=updated_version_ts).first()
#if not namespaced_keyvalue_updated:
# logging.warn("trying to modify an outdated record")
# return {'error': 'CONCURRENT_MODIFICATION_EXCEPTION'}, 409

curr_ts = round(time.time(), 2)
namespaced_keyvalue.updated_ts = curr_ts
Expand Down

0 comments on commit df8625a

Please sign in to comment.