From 414a5b4eab1df338817c2a0909207b85a5afefb2 Mon Sep 17 00:00:00 2001 From: Marcus Cobden Date: Wed, 30 Oct 2013 11:50:34 +0000 Subject: [PATCH] Only remove leading '0x' from key ids, not all 0s --- library/packaging/apt_key | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/packaging/apt_key b/library/packaging/apt_key index 48c3873eb3..764eed6b8e 100644 --- a/library/packaging/apt_key +++ b/library/packaging/apt_key @@ -191,7 +191,8 @@ def main(): if key_id: try: _ = int(key_id, 16) - key_id = key_id.lstrip('0x') + if key_id.startswith('0x'): + key_id = key_id[2:] except ValueError: module.fail_json("Invalid key_id")