Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
Use 'spec_string' for ReqSpec original string name.
Browse files Browse the repository at this point in the history
Previously it was 'req_spec_string' to distinquish
from RepositorySpec, but RepoSpec and ReqSpec are
separated now, so just use 'spec_string' for both
as that is what the repo spec parsing code does.

Add 'scm' attribute back to RequirementSpec.

Fixes part of #236

Fixes "AttributeError: 'RequirementSpec' object has no attribute 'scm'"
error on 'mazer install git+https://github.com/alikins/whatever'

(collection install still fails, but for a different reason)
  • Loading branch information
alikins committed May 14, 2019
1 parent ad3a1c9 commit 1fa2cbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions ansible_galaxy/models/requirement_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class RequirementSpec(object):
version_aka = attr.ib(default=None)
fetch_method = attr.ib(default=None, cmp=False)
src = attr.ib(default=None, cmp=False)
req_spec_string = attr.ib(default=None, cmp=False)
scm = attr.ib(default=None, cmp=False)

# If created from a parsed string, spec_string is copy of the full string
spec_string = attr.ib(default=None, cmp=False)

@property
def label(self):
Expand Down Expand Up @@ -58,7 +61,8 @@ def from_dict(cls, data):
version_spec=version_spec_str,
version_aka=data.get('version_aka', None),
fetch_method=data.get('fetch_method', None),
req_spec_string=data.get('req_spec_string', None),
scm=data.get('scm', None),
spec_string=data.get('spec_string', None),
src=data.get('src', None),
)
return instance
1 change: 0 additions & 1 deletion ansible_galaxy/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def from_dependencies_dict(dependencies_dict, namespace_override=None, editable=
namespace_override=namespace_override,
editable=editable)
req_spec_data['version_spec'] = req_version_spec
req_spec_data['req_spec_string'] = req_spec_data.pop('spec_string', None)

log.debug('req_spec_data: %s', req_spec_data)

Expand Down

0 comments on commit 1fa2cbe

Please sign in to comment.