lib/ec2/ec2.js
function(dbg, raFn, subName, g, name, argv_, context, outerCallback, callback) {

  var argv = _.extend({}, argv_);

  g[name] = {};

  return raFn(argv, context, function(err, result_) {
    if (err) { return sg.die(err, outerCallback, 'fetching '+name); }

    var result = subName ? result_[subName] : result_;
    if (_.isArray(result)) {
      g[name] = [];
      _.each(result, function(value) {
        g[name].push(value);
      });
    } else {
      _.each(result, function(value, key) {
        g[name][key] = value;
      });
    }

    // Get from prod
    var argv2      = _.extend({}, argv_, jsaws.getAcct('pub', process.env.JSAWS_AWS_ACCT_EXTRA_CREDS), {session:'prod'});

    return raFn(argv2, context, function(err, result_) {
      if (err) { return sg.die(err, outerCallback, 'fetching '+name); }

      var result = subName ? result_[subName] : result_;
      if (_.isArray(result)) {
        _.each(result, function(value) {
          g[name].push(value);
        });
      } else {
        _.each(result, function(value, key) {
          g[name][key] = value;
        });
      }

      return callback.apply(this, arguments);
    });
  });
}
function(dbg, raFn, subName, g, name, argv_, context, outerCallback, callback) {

  var argv = _.extend({}, argv_);

  g[name] = {};

  return raFn(argv, context, function(err, result_) {
    if (err) { return sg.die(err, outerCallback, 'fetching '+name); }

    var result = subName ? result_[subName] : result_;
    if (_.isArray(result)) {
      g[name] = [];
      _.each(result, function(value) {
        g[name].push(value);
      });
    } else {
      _.each(result, function(value, key) {
        g[name][key] = value;
      });
    }

    // Get from prod
    var argv2      = _.extend({}, argv_, jsaws.getAcct('pub', process.env.JSAWS_AWS_ACCT_EXTRA_CREDS), {session:'prod'});

    return raFn(argv2, context, function(err, result_) {
      if (err) { return sg.die(err, outerCallback, 'fetching '+name); }

      var result = subName ? result_[subName] : result_;
      if (_.isArray(result)) {
        _.each(result, function(value) {
          g[name].push(value);
        });
      } else {
        _.each(result, function(value, key) {
          g[name][key] = value;
        });
      }

      return callback.apply(this, arguments);
    });
  });
}
function ( dbg , raFn , subName , g , name , argv_ , context , outerCallback , callback ) { var argv = _ . extend ( { } , argv_ ) ; g [ name ] = { } ; return raFn ( argv , context , function ( err , result_ ) { if ( err ) { return sg . die ( err , outerCallback , 'fetching ' + name ) ; } var result = subName ? result_ [ subName ] : result_ ; if ( _ . isArray ( result ) ) { g [ name ] = [ ] ; _ . each ( result , function ( value ) { g [ name ] . push ( value ) ; } ) ; } else { _ . each ( result , function ( value , key ) { g [ name ] [ key ] = value ; } ) ; } // Get from prod var argv2 = _ . extend ( { } , argv_ , jsaws . getAcct ( 'pub' , process . env . JSAWS_AWS_ACCT_EXTRA_CREDS ) , { session : 'prod' } ) ; return raFn ( argv2 , context , function ( err , result_ ) { if ( err ) { return sg . die ( err , outerCallback , 'fetching ' + name ) ; } var result = subName ? result_ [ subName ] : result_ ; if ( _ . isArray ( result ) ) { _ . each ( result , function ( value ) { g [ name ] . push ( value ) ; } ) ; } else { _ . each ( result , function ( value , key ) { g [ name ] [ key ] = value ; } ) ; } return callback . apply ( this , arguments ) ; } ) ; } ) ; }
fetch, using creds, not contacting server in the other acct
fetch using creds not contacting server in the other acct