nebraska: Fix failures_per_url implicit string conversion.
XML parsers can't implicitly convert int to str. We need to explicitly
do this.
Strangely enough this is not failing the unittest, but on a DUT.
BUG=None
TEST=nebraska_unittest
Change-Id: Ibe1f4a969e09d5f85d1a6f0f852681de295d972a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2029928
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Auto-Submit: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
diff --git a/nebraska/nebraska.py b/nebraska/nebraska.py
index 76bfe51..01dec81 100755
--- a/nebraska/nebraska.py
+++ b/nebraska/nebraska.py
@@ -494,7 +494,7 @@
'event': 'postinstall'})
if self._response_props.failures_per_url is not None:
action.set('MaxFailureCountPerUrl',
- self._response_props.failures_per_url)
+ str(self._response_props.failures_per_url))
if self._critical_update:
action.set('deadline', 'now')
if self._app_data.public_key is not None:
diff --git a/nebraska/nebraska_unittest.py b/nebraska/nebraska_unittest.py
index b6e1f38..c6931cd 100755
--- a/nebraska/nebraska_unittest.py
+++ b/nebraska/nebraska_unittest.py
@@ -1211,7 +1211,7 @@
action_tag = response.findall(
'updatecheck/manifest/actions/action')[1]
- self.assertEqual(action_tag.attrib['MaxFailureCountPerUrl'], 1)
+ self.assertEqual(action_tag.attrib['MaxFailureCountPerUrl'], '1')
@mock.patch.object(nebraska.AppIndex, 'Find', return_value=GenerateAppData())
def testDisablePayloadBackoff(self, _):