Skip to content

Commit 0a6188b

Browse files
committed
Set correct pull request message for --dry-run case
When --only is used, if --dry-run is used it calls save_pr(), otherwise file_pr() is called. This fix ensures that the same string value is passed to the delta parameter of both functions. The call to save_pr was incorrectly passing the list args.only instead of the string delta which contains the contents of args.only This caused a TypeError exception in get_pr_text when concatenating the list to a string. File ".../superflore/superflore/utils.py", line 59, in get_pr_text msg += '\n' + delta + '\n' ~~~~~^~~~~~~ TypeError: can only concatenate str (not "list") to str Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
1 parent 816eb6a commit 0a6188b

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

superflore/generators/bitbake/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def main():
155155
markup=''), delta])
156156
overlay.commit_changes(args.ros_distro, commit_msg)
157157
if args.dry_run:
158-
save_pr(overlay, args.only, '', pr_comment, title=title)
158+
save_pr(overlay, delta, '', pr_comment, title=title)
159159
sys.exit(0)
160160
file_pr(overlay, delta, '', pr_comment, distro=args.ros_distro,
161161
title=title)

superflore/generators/ebuild/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ def main():
150150
regen_dict[args.ros_distro] = to_commit
151151
overlay.regenerate_manifests(regen_dict)
152152
overlay.commit_changes(args.ros_distro)
153+
delta = "Regenerated: '%s'\n" % args.only
153154
if args.dry_run:
154155
save_pr(
155156
overlay,
156-
args.only,
157+
delta,
157158
missing_deps=gen_missing_deps_msg(missing_depends),
158159
comment=pr_comment
159160
)
160161
sys.exit(0)
161-
delta = "Regenerated: '%s'\n" % args.only
162162
file_pr(
163163
overlay,
164164
delta,

superflore/generators/nix/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ def main():
143143
regen_dict = dict()
144144
regen_dict[args.ros_distro] = args.only
145145
overlay.commit_changes(args.ros_distro)
146+
delta = "Regenerated: '%s'\n" % args.only
146147
if args.dry_run:
147-
save_pr(overlay, args.only, '', pr_comment)
148+
save_pr(overlay, delta, '', pr_comment)
148149
sys.exit(0)
149-
delta = "Regenerated: '%s'\n" % args.only
150150
file_pr(overlay, delta, '', pr_comment, distro=args.ros_distro)
151151
ok('Successfully synchronized repositories!')
152152
sys.exit(0)

0 commit comments

Comments
 (0)