Skip to content

Commit

Permalink
fix too few arguments passed in get_subs_hook
Browse files Browse the repository at this point in the history
This commit add missing rosdistro argument when call super's get_subs_hook
it could be error when we generate RPM package, since rpm will deal with
release_history in get_subs_hook.
Also change the combine format string logic to one line since it is not
longer than 120.
  • Loading branch information
lennonwoo committed Jun 28, 2019
1 parent 645c283 commit 2449c99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions bloom/generators/rosdebian.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from bloom.generators.common import generate_substitutions_from_package
from bloom.generators.common import sanitize_package_name


from bloom.generators.debian import DebianGenerator
from bloom.generators.debian import format_description
from bloom.generators.debian import format_depends
Expand Down Expand Up @@ -81,7 +80,7 @@ def missing_dep_resolver(key, peer_packages, rosdistro):

@staticmethod
def get_subs_hook(subs, package, rosdistro, releaser_history=None):
subs = DebianGenerator.get_subs_hook(subs, package, releaser_history)
subs = DebianGenerator.get_subs_hook(subs, package, rosdistro, releaser_history=releaser_history)
subs['Package'] = rosify_package_name(subs['Package'], rosdistro)

# ROS 2 specific bloom extensions.
Expand Down Expand Up @@ -127,8 +126,7 @@ def generate_branching_arguments(self, package, branch):
return args

def get_release_tag(self, data):
return 'release/{0}/{1}/{2}-{3}'\
.format(self.rosdistro, data['Name'], data['Version'], self.inc)
return 'release/{0}/{1}/{2}-{3}'.format(self.rosdistro, data['Name'], data['Version'], self.inc)


def rosify_package_name(name, rosdistro):
Expand Down
7 changes: 3 additions & 4 deletions bloom/generators/rosrpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ def summarize(self):
return ret

@staticmethod
def missing_dep_resolver(self, key, peer_packages, rosdistro):
def missing_dep_resolver(key, peer_packages, rosdistro):
if key in peer_packages:
return [sanitize_package_name(rosify_package_name(key, rosdistro))]
return default_fallback_resolver(key, peer_packages, rosdistro)

@staticmethod
def get_subs_hook(subs, package, rosdistro, releaser_history=None):
subs = RpmGenerator.get_subs_hook(subs, package, releaser_history)
subs = RpmGenerator.get_subs_hook(subs, package, rosdistro, releaser_history=releaser_history)
subs['Package'] = rosify_package_name(subs['Package'], rosdistro)
return subs

Expand All @@ -93,8 +93,7 @@ def generate_branching_arguments(self, package, branch):
return args

def get_release_tag(self, data):
return 'release/{0}/{1}/{2}-{3}'\
.format(self.rosdistro, data['Name'], data['Version'], self.rpm_inc)
return 'release/{0}/{1}/{2}-{3}'.format(self.rosdistro, data['Name'], data['Version'], self.inc)


def rosify_package_name(name, rosdistro):
Expand Down

0 comments on commit 2449c99

Please sign in to comment.