Git Product home page Git Product logo

Comments (2)

trentm avatar trentm commented on June 4, 2024

it should be an error if 'name' is in the JSON file then
I.e. be strict

I don't want split brain there

from node-triton.

trentm avatar trentm commented on June 4, 2024

New example behaviour with stricter validation of these profile files:

[2015-09-10T00:25:36.989Z]  WARN: triton/59744 on danger0.local: error loading profile; skipping (profilePath=/Users/trentm/.triton/profiles.d/ams1.json, err.code=Config)
    ConfigError: error in "ams1" profile: /Users/trentm/.triton/profiles.d/ams1.json: file must not include "name" field
        at ConfigError.TritonError (/Users/trentm/joy/node-triton/lib/errors.js:38:12)
        at new ConfigError (/Users/trentm/joy/node-triton/lib/errors.js:73:17)
        at _profileFromPath (/Users/trentm/joy/node-triton/lib/config.js:232:15)
        at Object.loadAllProfiles (/Users/trentm/joy/node-triton/lib/config.js:268:27)
        at CLI._listProfiles (/Users/trentm/joy/node-triton/lib/do_profiles.js:31:31)
        at CLI.do_profiles (/Users/trentm/joy/node-triton/lib/do_profiles.js:155:5)
        at CLI.dispatch (/Users/trentm/joy/node-triton/node_modules/cmdln/lib/cmdln.js:744:13)
        at /Users/trentm/joy/node-triton/node_modules/cmdln/lib/cmdln.js:434:18
        at CLI.init (/Users/trentm/joy/node-triton/node_modules/cmdln/lib/cmdln.js:555:5)
        at CLI.init (/Users/trentm/joy/node-triton/lib/cli.js:227:26)
NAME         CURR  ACCOUNT     URL
coal-trentm        trentm      https://10.88.88.3
east1              trent.mick  https://us-east-1.api.joyent.com
...

or, e.g.:

$ triton profiles 2>&1 | bunyan
[2015-09-10T04:20:32.921Z]  WARN: triton/60218 on danger0.local: error loading profile; skipping (profilePath=/Users/trentm/.triton/profiles.d/ams1.json, err.code=Config)
    ConfigError: extraneous fields in "ams1" profile: /Users/trentm/.triton/profiles.d/ams1.json: foo
        at ConfigError.TritonError (/Users/trentm/joy/node-triton/lib/errors.js:38:12)
        at new ConfigError (/Users/trentm/joy/node-triton/lib/errors.js:73:17)
        at _validateProfile (/Users/trentm/joy/node-triton/lib/config.js:85:15)
        at _profileFromPath (/Users/trentm/joy/node-triton/lib/config.js:258:5)
        at Object.loadAllProfiles (/Users/trentm/joy/node-triton/lib/config.js:288:27)
        at CLI._listProfiles (/Users/trentm/joy/node-triton/lib/do_profiles.js:31:31)
        at CLI.do_profiles (/Users/trentm/joy/node-triton/lib/do_profiles.js:155:5)
        at CLI.dispatch (/Users/trentm/joy/node-triton/node_modules/cmdln/lib/cmdln.js:744:13)
        at /Users/trentm/joy/node-triton/node_modules/cmdln/lib/cmdln.js:434:18
        at CLI.init (/Users/trentm/joy/node-triton/node_modules/cmdln/lib/cmdln.js:555:5)
NAME         CURR  ACCOUNT     URL
coal-trentm        trentm      https://10.88.88.3
east1              trent.mick  https://us-east-1.api.joyent.com
...

from node-triton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.