Skip to content

Allow seed.mkconfig to accept OrderedDict #24071

Closed

Description

@Urth

Providing seed configuration from pillar/state files with the yaml renderer is not possible at this time.
The pillar/state yaml renderer uses dictclass=OrderedDict but when they are passed to, for example, lxc.bootstrap the config generated by seed.mkconfig uses the default yaml dumper to convert the config to a yaml string resulting in unusable config files.

>>> import collections
>>> d = collections.OrderedDict()
>>> d['master'] = 'salt'
>>> d['grains'] = ['things', 'and', 'stuff']
>>> import yaml
>>> yaml.dump(d, default_flow_style=False)
'!!python/object/apply:collections.OrderedDict\n- - - master\n    - salt\n  - - grains\n    - - things\n      - and\n      - stuff\n'```

Activity

  1. kiorky commented on May 24, 2015

    @kiorky
    Contributor

    Salt has some stuff to dump ordereddicts back to config files, i think your problem is elsewhere.

    refs #23982 #24080

  2. kiorky commented on May 24, 2015

    @kiorky
    Contributor

    @basepi i ll try to have a look to get this into the lxcconsistency pr

  3. kiorky commented on May 24, 2015

    @kiorky
    Contributor

    yep seeds.mkconfig (as you said) do not use the correctly routines to dump ...

  4. kiorky commented on May 24, 2015

    @kiorky
    Contributor

    @Urth i have a patch (testing it)

  5. kiorky commented on May 24, 2015

    @kiorky
    Contributor

    @Urth it is a part of my work on lxc, so you can have a look of both of the 2 linked PR, but the fix is in 96b8d55

  6. added
    bug
    severity-medium
    P4
    Platform
    fixed-pls-verify
    on May 26, 2015
  7. added this to the Approved milestone on May 26, 2015
  8. jfindlay commented on May 26, 2015

    @jfindlay
    Contributor

    @Urth, thanks for the report.

  9. kiorky commented on May 29, 2015

    @kiorky
    Contributor

    damn seems i didnt opened the pull request !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Platformbugfixed-pls-verifyseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions