Skip to content

Commit

Permalink
remove models.js logging for issue rockstor#1494
Browse files Browse the repository at this point in the history
  • Loading branch information
phillxnet committed Jan 22, 2017
1 parent bb69bc8 commit cf631b2
Showing 1 changed file with 0 additions and 9 deletions.
Expand Up @@ -61,7 +61,6 @@ var Disk = Backbone.Model.extend({
// A drive with no role shouldn't present a problem for use.
var role = this.get('role');
if (role == null) {
console.log("bb DISK model: ACCEPTING ROLE OF null")
return true;
}
// try json conversion and return false if it fails
Expand All @@ -77,31 +76,23 @@ var Disk = Backbone.Model.extend({
//
// Accept use of 'openLUKS' device
if (roleAsJson.hasOwnProperty('openLUKS')) {
console.log("bb DISK model: ACCEPTING ROLE OF openLUKS json = " + role);
return true;
}
// Accept use of 'partitions' device but only if it is accompanied
// by a 'redirect' role, ie so there is info to 'redirect' to the
// by-id name held as the value to the 'redirect' role key.
if (roleAsJson.hasOwnProperty('partitions') && roleAsJson.hasOwnProperty('redirect')) {
console.log("bb DISK model: EXAMINING ROLE OF partitioned COMBINED WITH redirect ROLE")
// then we need to confirm if the fstype of the redirected
// partition is "" else we can't use it
console.log("the redirect value = " + roleAsJson.redirect);
console.log("the fstype at the redirect partition = " + roleAsJson.partitions[roleAsJson.redirect]);
if (roleAsJson.partitions.hasOwnProperty(roleAsJson.redirect)) {
console.log("redirect value found in partition list")
if (roleAsJson.partitions[roleAsJson.redirect] == "") {
console.log("bb DISK model: ACCEPTING partition as empty fs type")
return true;
}
}
console.log("rejecting as non empty fstype in redirect partition")
}
// In all other cases return false, ie:
// reject roles of for example root, mdraid, LUKS,
// partitioned (when not accompanied by a valid redirect role) etc
console.log("bb DISK model: REJECTING ROLE with json = " + role);
return false;
}
});
Expand Down

0 comments on commit cf631b2

Please sign in to comment.