TRITON-301 TRITON-58 created a circular import dep between lib/cloudapi2.js and lib/common.js

Reviewed by: Trent Mick <trentm@gmail.com>
Reviewed by: Dave Eddy <dave.eddy@joyent.com>
Approved by: Trent Mick <trentm@gmail.com>
This commit is contained in:
Mike Zeller 2018-04-03 21:55:37 +00:00
parent 06812c9cd4
commit 96a5be8ce7
4 changed files with 10 additions and 10 deletions

View File

@ -154,13 +154,6 @@ function CloudApi(options) {
this.client = new SaferJsonClient(options);
}
// <Network Object Key> -> <expected typeof>
CloudApi.prototype.NETWORK_OBJECT_FIELDS = {
ipv4_uuid: 'string',
ipv4_ips: 'string'
};
CloudApi.prototype.close = function close(callback) {
this.log.trace({host: this.client.url && this.client.url.host},
'close cloudapi http client');

View File

@ -25,7 +25,7 @@ var wordwrap = require('wordwrap');
var errors = require('./errors'),
InternalError = errors.InternalError;
var NETWORK_OBJECT_FIELDS =
require('./cloudapi2').CloudApi.prototype.NETWORK_OBJECT_FIELDS;
require('./constants').NETWORK_OBJECT_FIELDS;
// ---- support stuff

View File

@ -46,11 +46,18 @@ if (process.env.TRITONTEST_CLI_CONFIG_DIR) {
CLI_CONFIG_DIR = mod_path.resolve(process.env.HOME, '.triton');
}
// <Network Object Key> -> <expected typeof>
var NETWORK_OBJECT_FIELDS = {
ipv4_uuid: 'string',
ipv4_ips: 'string'
};
// ---- exports
module.exports = {
CLI_CONFIG_DIR: CLI_CONFIG_DIR
CLI_CONFIG_DIR: CLI_CONFIG_DIR,
NETWORK_OBJECT_FIELDS: NETWORK_OBJECT_FIELDS
};

View File

@ -20,7 +20,7 @@ var distractions = require('../distractions');
var errors = require('../errors');
var mat = require('../metadataandtags');
var NETWORK_OBJECT_FIELDS =
require('../cloudapi2').CloudApi.prototype.NETWORK_OBJECT_FIELDS;
require('../constants').NETWORK_OBJECT_FIELDS;
function parseVolMount(volume) {
var components;