changed env vars to SC
This commit is contained in:
parent
f7f86ae7d5
commit
d589694608
@ -221,18 +221,18 @@ function validateProfile(profile, profilePath) {
|
|||||||
try {
|
try {
|
||||||
assert.string(profile.name, 'profile.name');
|
assert.string(profile.name, 'profile.name');
|
||||||
assert.string(profile.url,
|
assert.string(profile.url,
|
||||||
profile.name === 'env' ? 'TRITON_URL or SDC_URL' : 'profile.url');
|
profile.name === 'env' ? 'SC_URL' : 'profile.url');
|
||||||
assert.string(profile.account,
|
assert.string(profile.account,
|
||||||
profile.name === 'env' ? 'TRITON_ACCOUNT or SDC_ACCOUNT'
|
profile.name === 'env' ? 'SC_ACCOUNT'
|
||||||
: 'profile.account');
|
: 'profile.account');
|
||||||
assert.string(profile.keyId,
|
assert.string(profile.keyId,
|
||||||
profile.name === 'env' ? 'TRITON_KEY_ID or SDC_KEY_ID'
|
profile.name === 'env' ? 'SC_KEY_ID'
|
||||||
: 'profile.keyId');
|
: 'profile.keyId');
|
||||||
assert.optionalBool(profile.insecure,
|
assert.optionalBool(profile.insecure,
|
||||||
profile.name === 'env' ? 'TRITON_INSECURE or SDC_INSECURE'
|
profile.name === 'env' ? 'SC_INSECURE'
|
||||||
: 'profile.insecure');
|
: 'profile.insecure');
|
||||||
assert.optionalString(profile.user,
|
assert.optionalString(profile.user,
|
||||||
profile.name === 'env' ? 'TRITON_USER or SDC_USER'
|
profile.name === 'env' ? 'SC_USER'
|
||||||
: 'profile.user');
|
: 'profile.user');
|
||||||
assert.optionalString(profile.actAsAccount, 'profile.actAsAccount');
|
assert.optionalString(profile.actAsAccount, 'profile.actAsAccount');
|
||||||
assert.optionalArrayOfString(profile.roles, 'profile.roles');
|
assert.optionalArrayOfString(profile.roles, 'profile.roles');
|
||||||
@ -276,21 +276,18 @@ function _loadEnvProfile(profileOverrides) {
|
|||||||
name: 'env'
|
name: 'env'
|
||||||
};
|
};
|
||||||
|
|
||||||
envProfile.account = process.env.TRITON_ACCOUNT || process.env.SDC_ACCOUNT;
|
envProfile.account = process.env.SC_ACCOUNT;
|
||||||
var user = process.env.TRITON_USER || process.env.SDC_USER;
|
var user = process.env.SC_USER;
|
||||||
if (user) {
|
if (user) {
|
||||||
envProfile.user = user;
|
envProfile.user = user;
|
||||||
}
|
}
|
||||||
envProfile.url = process.env.TRITON_URL || process.env.SDC_URL;
|
envProfile.url = process.env.SC_URL;
|
||||||
envProfile.keyId = process.env.TRITON_KEY_ID || process.env.SDC_KEY_ID;
|
envProfile.keyId = process.env.SC_KEY_ID;
|
||||||
|
|
||||||
if (process.env.TRITON_TLS_INSECURE) {
|
if (process.env.SC_TLS_INSECURE) {
|
||||||
envProfile.insecure = common.boolFromString(
|
envProfile.insecure = common.boolFromString(
|
||||||
process.env.TRITON_TLS_INSECURE, undefined, 'TRITON_TLS_INSECURE');
|
process.env.SC_TLS_INSECURE, undefined, 'SC_TLS_INSECURE');
|
||||||
} else if (process.env.SDC_TLS_INSECURE) {
|
} else if (process.env.SC_TESTING) {
|
||||||
envProfile.insecure = common.boolFromString(
|
|
||||||
process.env.SDC_TLS_INSECURE, undefined, 'SDC_TLS_INSECURE');
|
|
||||||
} else if (process.env.SDC_TESTING) {
|
|
||||||
// For compatibility with the legacy behavior of the smartdc
|
// For compatibility with the legacy behavior of the smartdc
|
||||||
// tools, *any* set value but the empty string is considered true.
|
// tools, *any* set value but the empty string is considered true.
|
||||||
envProfile.insecure = true;
|
envProfile.insecure = true;
|
||||||
@ -349,7 +346,7 @@ function loadProfile(opts) {
|
|||||||
var envProfile = _loadEnvProfile(opts.profileOverrides);
|
var envProfile = _loadEnvProfile(opts.profileOverrides);
|
||||||
if (!envProfile) {
|
if (!envProfile) {
|
||||||
throw new errors.ConfigError('could not load "env" profile '
|
throw new errors.ConfigError('could not load "env" profile '
|
||||||
+ '(missing TRITON_*, or SDC_*, environment variables)');
|
+ '(missing SC_* environment variables)');
|
||||||
}
|
}
|
||||||
return envProfile;
|
return envProfile;
|
||||||
} else if (!opts.configDir) {
|
} else if (!opts.configDir) {
|
||||||
|
Reference in New Issue
Block a user