diff --git a/inventory_provider/juniper.py b/inventory_provider/juniper.py
index 4742147eea537efbcba196b1bad5e91d8d13cfa0..741ef352381f1b6213e9bfc936fcbe8ac0c3ee61 100644
--- a/inventory_provider/juniper.py
+++ b/inventory_provider/juniper.py
@@ -281,15 +281,14 @@ def vpn_rr_peers(netconf_config):
             '/protocols/bgp/'
             'group[name/text()="VPN-RR" or name/text()="VPN-RR-INTERNAL"]/'
             'neighbor'):
-        peer_as = r.find('peer-as')
-        if peer_as is not None:
-            peer_as = int(r.find('peer-as').text)
-        yield {
+        neighbor = {
             'name': ipaddress.ip_address(r.find('name').text).exploded,
             'description': r.find('description').text,
-            'peer-as': peer_as
         }
-
+        peer_as = r.find('peer-as')
+        if peer_as is not None:
+            neighbor['peer-as'] = int(r.find('peer-as').text)
+        yield neighbor
 
 # note for enabling vrr data parsing ...
 # def fetch_vrr_config(hostname, ssh_params):