MCPcopy Index your code
hub / github.com/scality/cloudserver / _getLocationConfig

Method _getLocationConfig

lib/Config.js:847–873  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

845 }
846
847 _getLocationConfig() {
848 let locationConfig;
849 try {
850 const data = fs.readFileSync(this.locationConfigPath,
851 { encoding: 'utf-8' });
852 locationConfig = JSON.parse(data);
853 } catch (err) {
854 throw new Error(`could not parse location config file:
855 ${err.message}`);
856 }
857
858 this.locationConstraints = {};
859 locationConstraintAssert(locationConfig);
860 this.locationConstraints = locationConfig;
861 Object.keys(locationConfig).forEach(l => {
862 const details = this.locationConstraints[l].details;
863 if (locationConfig[l].details.connector !== undefined) {
864 assert(typeof locationConfig[l].details.connector ===
865 'object', 'bad config: connector must be an object');
866 if (locationConfig[l].details.connector.sproxyd !==
867 undefined) {
868 details.connector.sproxyd = parseSproxydConfig(
869 locationConfig[l].details.connector.sproxyd);
870 }
871 }
872 });
873 }
874
875 _loadTlsFile(tlsFileName) {
876 if (!tlsFileName) {

Callers 1

constructorMethod · 0.95

Calls 2

locationConstraintAssertFunction · 0.85
parseSproxydConfigFunction · 0.85

Tested by

no test coverage detected