Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
slapos slapos
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 122
    • Merge requests 122
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slaposslapos
  • Merge requests
  • !231

Closed
Created Sep 29, 2017 by Alain Takoudjou@alain.takoudjouMaintainer
  • Report abuse
Report abuse

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

  • Overview 5
  • Commits 1
  • 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
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: slap-configuration
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7