<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/16572">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">asterisk.py: Fix TypeError when replacing instanceid<br><br>id = 23<br>value = "test <<instanceid>> test"<br>value.replace("<<instanceid>>", id) fails with a TypeError because<br>replace doesn't automatically convert the numeric replacement<br>argument to a string.<br><br>Now doing value.replace("<<instanceid>>", str(id))<br><br>ASTERISK-29675<br><br>Change-Id: I16ec4dc84303ae3c3bdd1884959559675f6143c8<br>---<br>M lib/python/asterisk/asterisk.py<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/lib/python/asterisk/asterisk.py b/lib/python/asterisk/asterisk.py</span><br><span>index f1371db..08c4e9a 100644</span><br><span>--- a/lib/python/asterisk/asterisk.py</span><br><span>+++ b/lib/python/asterisk/asterisk.py</span><br><span>@@ -675,7 +675,7 @@</span><br><span> for key in self.directories.keys():</span><br><span> value = value.replace("<<%s>>" % key,</span><br><span> "%s%s" % (self.base, self.directories[key]))</span><br><span style="color: hsl(0, 100%, 40%);">- value = value.replace("<<instanceid>>", self.instance_id)</span><br><span style="color: hsl(120, 100%, 40%);">+ value = value.replace("<<instanceid>>", str(self.instance_id))</span><br><span> return value</span><br><span> </span><br><span> # Quick little function for doing search and replace in a file used below.</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/16572">change 16572</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/16572"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I16ec4dc84303ae3c3bdd1884959559675f6143c8 </div>
<div style="display:none"> Gerrit-Change-Number: 16572 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>