Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing some issues

  • Loading branch information...
commit 2736bd970b3f7a5a78418eb73c64aa9af4ae560f 1 parent 3fabff5
@andrerod andrerod authored
View
24 lib/services/core/servicesettings.js
@@ -67,17 +67,31 @@ exports.parseAndValidateKeys = function (connectionString, validKeys) {
exports.getValidator = function (requirements, isRequired, atLeastOne) {
return function (userSettings) {
var oneFound = false;
- var result = _.map(userSettings, function(setting) { return setting.toLowerCase(); });
+
+ var result = { };
+ for (var key in userSettings) {
+ result[key.toLowerCase()] = userSettings[key];
+ }
for (var requirement in requirements) {
var settingName = requirements[requirement]['SettingName'].toLowerCase();
+ console.log('humm');
+
// Check if the setting name exists in the provided user settings.
if (result[settingName]) {
+
+ console.log('entrei aqui');
+
// Check if the provided user setting value is valid.
- var validationFunc = requirement['SettingConstraint'];
+ var validationFunc = requirements[requirement]['SettingConstraint'];
+ console.log(validationFunc.toString());
var isValid = validationFunc(result[settingName]);
+console.log(isValid);
+console.log(validationFunc);
+console.log('hey there');
+
if (isValid) {
// Remove the setting as indicator for successful validation.
delete result[settingName];
@@ -115,10 +129,8 @@ exports.setting = function (name) {
return true;
}
- // Check to find if the $settingValue is valid or not. The index must
- // start from 1 as unset deletes the value but does not update the array
- // indecies.
- for (var index = 1; index < validValues.length; validValues++) {
+ // Check to find if the $settingValue is valid or not.
+ for (var index = 0; index < validValues.length; validValues++) {
if (settingValue === validValues[index]) {
// SettingValue is found in valid values set, succeed.
return true;
View
5 lib/services/core/storageservicesettings.js
@@ -26,7 +26,7 @@ var Validate = require('../../util/validate');
exports = module.exports = StorageServiceSettings;
var _devStoreAccount = null;
-var _useDevelopmentStorageSetting = ServiceSettings.setting(ConnectionStringKeys.USE_DEVELOPMENT_STORAGE_NAME, 'true');
+var _useDevelopmentStorageSetting = ServiceSettings.setting(ConnectionStringKeys.USE_DEVELOPMENT_STORAGE_NAME, true);
var _developmentStorageProxyUriSetting = ServiceSettings.settingWithFunc(ConnectionStringKeys.DEVELOPMENT_STORAGE_PROXY_URI_NAME, Validate.getIsValidUri());
var _defaultEndpointsProtocolSetting = ServiceSettings.setting(ConnectionStringKeys.DEFAULT_ENDPOINTS_PROTOCOL_NAME, 'http', 'https');
var _accountNameSetting = ServiceSettings.setting(ConnectionStringKeys.ACCOUNT_NAME_NAME);
@@ -215,6 +215,9 @@ StorageServiceSettings.createFromConnectionString = function (connectionString)
ServiceSettings.optional(_developmentStorageProxyUriSetting)
);
+ console.log(matchedSpecs);
+ console.log(tokenizedSettings)
+
if (matchedSpecs) {
proxyUri = util.tryGetValueInsensitive(
ConnectionStringKeys.DEVELOPMENT_STORAGE_PROXY_URI_NAME,
Please sign in to comment.
Something went wrong with that request. Please try again.