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

1103311 - Extract any unit_key fields from metadata if None #126

Merged
merged 1 commit into from Jun 5, 2014

Conversation

daviddavis
Copy link
Contributor

If no unit_key metadata is passed in for uploaded puppet modules, just use the
module metadata to populate name, author, and version.

https://bugzilla.redhat.com/show_bug.cgi?id=1103311

TODO

  • Add tests
  • Address any feedback

@@ -152,7 +153,7 @@ def _extract_non_standard_json(module, filename, temp_dir):
:raise MissingModuleFile: if the module's metadata file cannot be found
"""

extraction_dir = os.path.join(temp_dir, module.author, module.name, module.version)
extraction_dir = os.path.join(temp_dir, (filename + EXTRACT_DIRECTORY_SUFFIX))
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to use the tempfile.mkdtemp module from the standard library to create a temporary directory. That's what this probably should have done to begin with.


from pulp.server.exceptions import InvalidValue

from pulp_puppet.common import constants

from pulp.common.compat import json
Copy link
Contributor

Choose a reason for hiding this comment

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

for pep8, put this right above line 25.

If no unit_key metadata is passed in for uploaded puppet modules, just use the
module metadata to populate name, author, and version.

https://bugzilla.redhat.com/show_bug.cgi?id=1103311
@mhrivnak
Copy link
Contributor

mhrivnak commented Jun 5, 2014

LGTM

mhrivnak added a commit that referenced this pull request Jun 5, 2014
1103311 - Extract any unit_key fields from metadata if None
@mhrivnak mhrivnak merged commit ce1e70b into pulp:master Jun 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants