MCPcopy
hub / github.com/scality/cloudserver / initManagementDatabase

Function initManagementDatabase

lib/management/index.js:30–49  ·  view source on GitHub ↗
(log, callback)

Source from the content-addressed store, hash-verified

28const pushEndpoint = `${pushEndpointRoot}/api/v1/instance`;
29
30function initManagementDatabase(log, callback) {
31 // XXX choose proper owner names
32 const md = new arsenal.models.BucketInfo(managementDatabaseName, 'owner',
33 'owner display name', new Date().toJSON());
34
35 metadata.createBucket(managementDatabaseName, md, log, error => {
36 if (error) {
37 if (error.is.BucketAlreadyExists) {
38 log.info('created management database');
39 return callback();
40 }
41 log.error('could not initialize management database',
42 { error: reshapeExceptionError(error),
43 method: 'initManagementDatabase' });
44 return callback(error);
45 }
46 log.info('initialized management database');
47 return callback();
48 });
49}
50
51function startManagementListeners(instanceId, token) {
52 const mode = process.env.MANAGEMENT_MODE || 'push';

Callers 2

initManagementFunction · 0.85
configuration.jsFile · 0.85

Calls 2

infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected