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

Updates metadata.json search to look in first top-level folder #177

Merged
merged 1 commit into from
Apr 28, 2015

Conversation

bmbouter
Copy link
Member

The implementation was using a depth-first-search which did not
traverse in the same order on all platforms. Some Puppet modules
contain other modules as dependencies, and the DFS implementation
could incorrectly find the wrong one. This uses a very dumb
approach which looks for metadata.json in the top level folder
of the the tar.gz uploaded Puppet module. This is based on the
Puppet packaging guidelines 0.

https://pulp.plan.io/issues/890
closes #890

# Attempt to find the metadata in the first folder of the tar.gz
module_dir = os.listdir(extraction_dir)[0]
metadata_filename = constants.MODULE_METADATA_FILENAME
metadata_full_path = os.sep.join([extraction_dir, module_dir, metadata_filename])
Copy link
Contributor

Choose a reason for hiding this comment

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

How about os.path.join instead? I've never used os.sep directly, but I see that its documentation recommends using os.path.join.

Copy link
Member Author

Choose a reason for hiding this comment

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

os.path.join is better, I updated it for that.

@bmbouter bmbouter force-pushed the 890-pumpkin branch 3 times, most recently from 5c98f3d to 89762c9 Compare April 24, 2015 17:51
@mhrivnak mhrivnak added the LGTM label Apr 26, 2015
The implementation was using a depth-first-search which did not
traverse in the same order on all platforms. Some Puppet modules
contain other modules as dependencies, and the DFS implementation
could incorrectly find the wrong one. This uses a very dumb
approach which looks for metadata.json in the top level folder
of the the tar.gz uploaded Puppet module. This is based on the
Puppet packaging guidelines [0].

[0]:  https://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html#module-fundamentals

https://pulp.plan.io/issues/890
closes #890
@pulpbot
Copy link
Member

pulpbot commented Apr 28, 2015

Refer to this link for build results (access rights to CI server needed):
https://pulp-jenkins.rhev-ci-vms.eng.rdu2.redhat.com//job/unittest-pulp_puppet-pr/17/
Test PASSed.

bmbouter added a commit that referenced this pull request Apr 28, 2015
Updates metadata.json search to look in first top-level folder
@bmbouter bmbouter merged commit 3147335 into pulp:2.6-dev Apr 28, 2015
@bmbouter bmbouter deleted the 890-pumpkin branch April 28, 2015 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants