Skip to content

win_pkg New Reporting for genrepo refresh_db & Fix #35342 #34781, New Unicode Support Software Names - #35899

Merged
rallytime merged 14 commits into
saltstack:developfrom
damon-atkins:win-fix-35342-n-34781-reg-unicode
Sep 1, 2016
Merged

rallytime merged 14 commits into
saltstack:developfrom
damon-atkins:win-fix-35342-n-34781-reg-unicode

Conversation

@damon-atkins

@damon-atkins damon-atkins commented Aug 30, 2016 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix #35342
Issue: win_pkg: refresh_db doesn't remove cached items which have been
renamed or removed
Solution: Conservative solution was to just remove *.sls files from
\win\repo-ng tree as part of pkg.refresh_db instead of removing all
of \win\repo-ng\salt-winrepo-ng

Fix #34781
Issue: Logs did not contain enough information, and from executing it from the
master it was too difficult to determine if there was an issue due to the
output being data
Solution:

  • pkg.genrepo now reports the status of the operation instead of the
    large about of metadata. The status report indicates:
  • Total SLS Files processed
  • Number of failed sls files
  • Number of successful sls files
  • list of files with errors and the render/compile errors they had
  • optionally a list of successfully render/compiled files and the
    package names within those files
  • pkg.refresh_db was also part of this issue, as it just reported a list
    of files copied from the same large list of files would be reported almost
    every time. As pkg.refresh_db calls pkg.genrepo after copy all the files
    it now reports the same as data as pkg.genrepo.

Unicode Support
Issue: Windows Registry module supports Unicode in development, win_pkg
needed to be updated to support the Unicode output from reg.

What issues does this PR fix or reference?

Previous Behavior

pkg.genrepo return the data structure of the sls files, to did not report few issues to local logs, did not report any issues back to the master.

pkg.refresh_db
*provide a list of files copy from the master, the list of files copied was long always, as it was not a sync process.

  • called pkg.genrepo but did not report any issues or errors.

New Behavior

Both pkg.genrepo and pkg.refresh_db report the same output from pkg.genrepo.
pkg.genrepo reports the status of render the files.

pkg.list_pkgs
Supports Unicode. It was dependant on Unicode changes to reg.py.
See Windows Registry Unicode Support and PY2 character encoding (module.reg) #32835

Tests written?

No Extra Tests. Tested against salt-winrepo-ng sls files.

Fix#35342
 Issue: win_pkg: refresh_db doesn't remove cached items which have been
renamed or removed
 Solution: Conservative solution was to just remove *.sls files from
\win\repo-ng  tree  as part of pkg.refresh_db instead of removing all
of \win\repo-ng\salt-winrepo-ng

Fix#34781
 Issue: Logs did not contain enough information, and from executing it from the
master it was too difficult to determine if there was an issue due to the
output being data
 Solution:
* pkg.genrepo now reports the status of the operation instead of the
large about of metadata. The status report indicates:
- Total SLS Files processed
- Number of failed sls files
- Number of successful sls files
- list of files with errors and the render/compile errors they had
- optionally a list of successfully render/compiled files and the
package names within those files
* pkg.refresh_db was also part of this issue, as it just reported a list
of files copied from the same large list of files would be reported almost
every time. As pkg.refresh_db calls pkg.genrepo after copy all the files
it now reports the same as data as pkg.genrepo.

Unicode Support
  Issue: Windows Registry module supports Unicode in development, win_pkg
needed to be updated to support the Unicode output from reg.
Damon Atkins added 9 commits August 31, 2016 02:36
function which has been removed
* With Windows we ignore issues with refresh_db existing behaviour,
update win_pkg.py to not report errors with refresh_db back
to states/pkg.py. As part of doing this created an internal version
if refresh_db called _refresh_db with different defaults
@damon-atkins

Copy link
Copy Markdown
Contributor Author

Seems these failures are not part of this PR. Please merge into Develop.

unit.states.dockerng_test.DockerngTestCase.test_image_present_and_force
unit.states.grains_test.GrainsTestCase.test_present_fail_overwrite
unit.states.grains_test.GrainsTestCase.test_present_overwrite
integration.states.file.FileTest.test_managed_file_mode_keep_local_source
integration.states.file.FileTest.test_template_local_file
integration.states.file.FileTest.test_template_local_file_noclobber

@damon-atkins

damon-atkins commented Sep 1, 2016 •

Copy link
Copy Markdown
Contributor Author

Not sure why jenkins/PR/salt-pr-linode-ubuntu14-n is reporting

93153 blocks
++ git rev-parse HEAD
+ '[' 1bb27255cb81d2ce7f0705418eb77e28e439358a '!=' 1cd499cb7fa5c2ca068613ecfc20d5881cf4ff87 ']'
++ git rev-parse HEAD
+ echo 'Commits don'\''t match 1bb27255cb81d2ce7f0705418eb77e28e439358a == 1cd499cb7fa5c2ca068613ecfc20d5881cf4ff87'
Commits don't match 1bb27255cb81d2ce7f0705418eb77e28e439358a == 1cd499cb7fa5c2ca068613ecfc20d5881cf4ff87
+ echo 'Stopping execution'

Maybe its to do with me fetching an merging develop to update the branch

@damon-atkins

Copy link
Copy Markdown
Contributor Author

Thanks @meggiebot look forward to the feedback.
Interesting seems to of grabbed someone elses PR
https://jenkins.saltstack.com/job/PR/job/salt-pr-lint-n/4875/console

16:32:22 ************* Module salt.modules.mongodb
16:32:22 salt/modules/mongodb.py:488: [E8201(whitespace-after-left-parenthesis), ] PEP8 E201: whitespace after '('
16:32:22 salt/modules/mongodb.py:488: [E8202(whitespace-before-right-parenthesis), ] PEP8 E202: whitespace before ')'
16:32:22 salt/modules/mongodb.py:473: [C0303(trailing-whitespace), ] Trailing whitespace
16:32:22 salt/modules/mongodb.py:484: [C0303(trailing-whitespace), ] Trailing whitespace
16:32:22 salt/modules/mongodb.py:488: [C0326(bad-whitespace), ] No space allowed after bracket
16:32:22             ids = col.update_one( _id_field, {'$set': _update_doc} )
16:32:22                                 ^
16:32:22 salt/modules/mongodb.py:488: [C0326(bad-whitespace), ] No space allowed before bracket
16:32:22             ids = col.update_one( _id_field, {'$set': _update_doc} )
16:32:22                                                                    ^
16:32:22 salt/modules/mongodb.py:492: [C0303(trailing-whitespace), ] Trailing whitespace

@damon-atkins

Copy link
Copy Markdown
Contributor Author

Remove a blank line to pull the focus back on this PR

@damon-atkins

Copy link
Copy Markdown
Contributor Author

Hi @rallytime seem to be getting lint issues from salt/modules/mongodb.py in develop outside of this PR.

@rallytime

Copy link
Copy Markdown
Contributor

Hi @damon-atkins - Yeah I just fixed those at the HEAD of the develop branch. Don't worry about those for now. :)

@rallytime

Copy link
Copy Markdown
Contributor

Thank you for your work here @damon-atkins!

@rallytime
rallytime merged commit 8f85995 into saltstack:develop Sep 1, 2016
@damon-atkins damon-atkins changed the title win_pkg Fix#35342 Fix#34781 Unicode Support win_pkg genrepo refresh_db Fix#35342 Fix#34781 New Unicode Support Sep 2, 2016
@damon-atkins damon-atkins changed the title win_pkg genrepo refresh_db Fix#35342 Fix#34781 New Unicode Support win_pkg New Reporting for genrepo refresh_db & Fix#35342 Fix#34781, New Unicode Support Software Names Sep 2, 2016
@damon-atkins damon-atkins changed the title win_pkg New Reporting for genrepo refresh_db & Fix#35342 Fix#34781, New Unicode Support Software Names win_pkg New Reporting for genrepo refresh_db & Fix #35342 #34781, New Unicode Support Software Names Sep 2, 2016
@damon-atkins
damon-atkins deleted the win-fix-35342-n-34781-reg-unicode branch September 2, 2016 09:12
Comment thread salt/modules/win_pkg.py
os.makedirs(repo_local)
winrepo = os.path.join(repo_local, 'winrepo.p')

try:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the point of a try/except here, if all we do is raise the exception? 😕

@damon-atkins

Copy link
Copy Markdown
Contributor Author

I plan on doing another review of the code for example 'winrepo.p' is hard coded, and has been since day 1 by the look of it, but I notice in the doco their is a setting to set the name of for 'winrepo.p'

Re your commends it should most likely just return -1 rather than raise an issue. Was not sure how to capture permission problems on windows. Going to put more smarts into _get_repo_src_dest pull some of the repeated code out in other sections.

@damon-atkins

Copy link
Copy Markdown
Contributor Author

@meggiebot some items for release notes:

@meggiebot

Copy link
Copy Markdown

@damon-atkins Thanks! I let our doc guy know about your additions to the release notes. Just as an FYI, you can actually edit the release notes files and make any additions yourself.

The Carbon release notes are here:
https://github.com/saltstack/salt/blob/carbon/doc/topics/releases/carbon.rst

The develop (currently leading up to Nitrogen) release notes are here:
https://github.com/saltstack/salt/blob/develop/doc/topics/releases/nitrogen.rst

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

Labels

None yet

Projects

None yet

4 participants