Skip to content

Commit

Permalink
Merge pull request cablelabs#200 from cablelabs/issue-155
Browse files Browse the repository at this point in the history
When a Put happens on a authorized network, do not pull or push.  Thi…
  • Loading branch information
dschrimpsher authored Nov 8, 2018
2 parents e11459f + 2a96fd5 commit e566339
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion rest/networkProtocols/LoRaOpenSource_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,6 @@ module.exports.pushDeviceProfile = function (sessionData, network, deviceProfile
})
}
else {
appLogger.log('WTF')
appLogger.log(dpNetworkId + '')

reject(new Error('Something bad happened with the Protocol Table'))
Expand Down
4 changes: 4 additions & 0 deletions rest/restNetworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ exports.initialize = function (app, server) {
restServer.isAdminCompany],
function (req, res, next) {
var data = req.body
var pullFlag = (data.securityData && data.securityData.authorized === false)
data.id = parseInt(req.params.id)
modelAPI.networks.updateNetwork(data)
.then(function (rec) {
Expand Down Expand Up @@ -498,6 +499,9 @@ exports.initialize = function (app, server) {
if (network.securityData.authorized === false) {
restServer.respond(res, 200, network)
}
else if (!pullFlag) {
restServer.respond(res, 200, network)
}
else {
modelAPI.networks.pullNetwork(network.id)
.then(result => {
Expand Down

0 comments on commit e566339

Please sign in to comment.