Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • slapos slapos
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 129
    • Merge requests 129
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • slaposslapos
  • Merge requests
  • !231

WIP: bug-fix: prevent buildout to fail when option value is None

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Alain Takoudjou requested to merge slap-configuration into master Sep 29, 2017
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 1

When a parameter is None the recipe slapconfiguration fail with the message below:

  2017-09-29 15:51:49 slapos[26200] INFO While:
  2017-09-29 15:51:49 slapos[26200] INFO   Installing.
  2017-09-29 15:51:49 slapos[26200] INFO   Getting section switch_softwaretype.
  2017-09-29 15:51:49 slapos[26200] INFO   Initializing section switch_softwaretype.
  2017-09-29 15:51:49 slapos[26200] INFO   Getting option switch_softwaretype:default.
  2017-09-29 15:51:49 slapos[26200] INFO   Getting option switch_softwaretype:kvm.
  2017-09-29 15:51:49 slapos[26200] INFO   Getting section dynamic-template-kvm.
  2017-09-29 15:51:49 slapos[26200] INFO   Initializing section dynamic-template-kvm.
  2017-09-29 15:51:49 slapos[26200] INFO   Getting section slap-configuration.
  2017-09-29 15:51:49 slapos[26200] INFO   Initializing section slap-configuration.
  2017-09-29 15:51:49 slapos[26200] INFO Error: Missing option: slap-configuration:tun

I realized that when a parameter (which has default value to '') is not set by the user while requesting instance, it become None then adding options[key] = None in slapconfiguration will make buildout angry. If I print the result of options at the end, all keys with values equal to None are missing.

I general If do this:

     [request-xxxx]
     .....
     config-foo-bar = {{ dumps(kvm_parameter_dict.get('foo-bar', '')) }}

or

    [param-fooo]
    bar = 
    
     [request-xxxx]
     .....
     config-foo-bar = ${param-fooo:bar}

Buildout will raise with exception saying Error: Missing option: slap-configuration:foo-bar. Setting the value to empty string instead of None solve the problem.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: slap-configuration
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7