Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
P
picomon
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • arn
  • picomon
  • Merge Requests
  • !7

Closed
Opened May 12, 2014 by Colomban Wendling@b4n
  • Report abuse
Report abuse

Make config set options inside the lib module

Instead of depending on config.py defining several magic variables, move the default configuration at the root of the lib module, and make config.py override them as needed.

This prevents config.py from being a required magic part that the user have to write correctly and completely for picomon to work. With this change, config.py still can do anything it want, but the other parts of the code don't completely depend on it defining some variables out of the blue.

This gives us default values for the settings where appropriate, which allows seamless upgrade paths in practice, as a config.py from an older version is likely to work for a new one (unless of course some new, default on, feature requires a non-default configuration value).


It may feel more natural if the lib module was renamed to picomon as setting picomon.checks might be more explicit than lib.checks, but it is a little outside the scope of this change and should be done separately if at all.

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch "https://gitlab.netlib.re/b4n/picomon.git" "cleaner-config"
git checkout -b "b4n/picomon-cleaner-config" FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "origin/master"
git merge --no-ff "b4n/picomon-cleaner-config"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 3
  • Commits 1
  • Changes
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: arn/picomon!7