Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify map.jinja revert deep_merge solution from #193 #395

Merged
merged 3 commits into from
Jan 26, 2019
Merged

Simplify map.jinja revert deep_merge solution from #193 #395

merged 3 commits into from
Jan 26, 2019

Conversation

aboe76
Copy link
Member

@aboe76 aboe76 commented Jan 25, 2019

In a discussion on #193 and a pr #248 there is a attempt to make map.jinja easier to maintain and functional.

The deep_merge solution was created based on the fact that centos 6 didn't have mapping support in jinja2, but with the saltstack repos and epel repos having a newer version of jinja2 > 2.6 this is no longer necessary. Jinja2 from 2.6 and higher support mapping.

I have tested this new setup, with defaults.yaml, osfamilymap.yaml and osmap.yaml on the following systems without issues:

  • centos 7
  • redhat 7
  • opensuse
  • fedora 29
  • ubuntu 18.04
  • debian 9
  • Centos 6 ( clean minimal install with only saltstack repo added)

!!!! Please be carefull with merging, could lead to unexpected behavior without testing first. !!!!

salt/osmap.yaml Outdated Show resolved Hide resolved
@myii myii changed the title simplify map.jinja revert deep_merge solution from #193 WIP: simplify map.jinja revert deep_merge solution from #193 Jan 25, 2019
@myii
Copy link
Member

myii commented Jan 25, 2019

@aboe76 Initial tests are getting consistent results so far. One section of the rendering is different, though:

--- master
+++ aboe76-simplify-map.jinja
@@ -1,13 +1,9 @@
 'gitfs': {
     'pygit2': {
         'git': {
-            'install_from_package': None,
+            'install_from_package': 'None',
             'require_state': False
         },
-        'install_from_source': False,
-        'libgit2': {
-            'install_from_source': False
-        },
-        'version': '0.22.1'
+        'install_from_source': False
     }
 },
     }
 },

Update: Forgot to mention, these are various Ubuntu minions.

salt/map.jinja Outdated Show resolved Hide resolved
Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensures 'install_from_package': None rather than as a string: 'None'.

salt/osmap.yaml Outdated Show resolved Hide resolved
@myii
Copy link
Member

myii commented Jan 26, 2019

Changed the title to prefix with WIP: to prevent an accidental merge, which works on GitLab. What's the equivalent in GitHub?

@aboe76
Copy link
Member Author

aboe76 commented Jan 26, 2019

@myii about the title, thanks for changing it to something usefull, about protecting from PR merging without aproval with github, this is only possible in settings, which is unavailable at our level in this organization....see https://help.github.com/articles/enabling-required-reviews-for-pull-requests/

@myii
Copy link
Member

myii commented Jan 26, 2019

@aboe76 Got a new diff for you after 66c0699:

--- master
+++ aboe76-simplify-map.jinja
@@ -1,5 +1,10 @@
- 'gitfs': {'pygit2': {'git': {'install_from_package': None,
+ 'gitfs': {'dulwich': {'install_from_source': True},
+           'gitpython': {'install_from_source': False},
+           'pygit2': {'git': {'install_from_package': None,
                               'require_state': False},
                       'install_from_source': False,
-                      'libgit2': {'install_from_source': False},
-                      'version': '0.22.1'}},
+                      'libgit2': {'build_parent_dir': '/usr/src/',
+                                  'download_hash': '683d1164e361e2a0a8d52652840e2340',
+                                  'install_from_source': False,
+                                  'version': '0.23.0'},
+                      'version': '0.22.1'}},

As far as I can tell, this is an improvement, where the defaults are being merged properly rather than overwritten. Meaning, it appears that the current method used in the master branch has a problem and this PR will fix that.

@aboe76
Copy link
Member Author

aboe76 commented Jan 26, 2019

@myii nice, thanks for reviewing,

Installing a centos 6 vm to test against.

@aboe76 aboe76 added the WIP Work in Progress, only merge after review label Jan 26, 2019
Copy link
Member

@noelmcloughlin noelmcloughlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot see any code issues, LGTM. thanks @aboe76 and @myii

@aboe76
Copy link
Member Author

aboe76 commented Jan 26, 2019

@noelmcloughlin would like some more input before merging from:
@javierbertoli

and maybe somebody from:
@saltstack-formulas/core
@saltstack-formulas/moderators

Copy link
Member

@javierbertoli javierbertoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It LGTM too. Nice refactoring, @aboe76! As soon as you don't consider it more a WIP I think we're OK to merge?

@myii
Copy link
Member

myii commented Jan 26, 2019

@noelmcloughlin @aboe76 Can this be merged? I've got another PR to submit for PY3 support and I've based it on these changes since I don't want to have to redo it again when this gets merged.

@noelmcloughlin
Copy link
Member

+1 merge. @javierbertoli gave +1 while back.

@myii myii changed the title WIP: simplify map.jinja revert deep_merge solution from #193 Simplify map.jinja revert deep_merge solution from #193 Jan 26, 2019
@myii myii removed the WIP Work in Progress, only merge after review label Jan 26, 2019
@myii
Copy link
Member

myii commented Jan 26, 2019

@noelmcloughlin Great, I've gone ahead and removed the references to WIP. Are we still waiting for another review from one of the groups mentioned above?

@noelmcloughlin
Copy link
Member

No merge away!!!

@myii myii merged commit 1d9643b into saltstack-formulas:master Jan 26, 2019
@myii
Copy link
Member

myii commented Jan 26, 2019

Confirmed all OK with @noelmcloughlin via. Slack.

Great work, @aboe76. Thanks to @javierbertoli and @noelmcloughlin for the reviews.

@aboe76
Copy link
Member Author

aboe76 commented Jan 26, 2019

@myii, @noelmcloughlin and @javierbertoli thanks for reviewing..

m2mobi-mirror pushed a commit to move-sysadmin/salt-formula that referenced this pull request Mar 19, 2021
Pull request saltstack-formulas#395 indicates that this is no longer needed.
SMillerDev pushed a commit to move-sysadmin/salt-formula that referenced this pull request May 19, 2023
Pull request saltstack-formulas#395 indicates that this is no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants