@@ -1085,19 +1085,33 @@ class DebianDistro(Distro):
1085
1085
def __init__ (self , * args , ** kwargs ):
1086
1086
Distro .__init__ (self , * args , ** kwargs )
1087
1087
1088
- # Pull the tree's arch out of the URL text
1089
- self ._treeArch = "i386"
1090
- for pattern in ["^.*/installer-(\w+)/?$" ,
1091
- "^.*/daily-images/(\w+)/?$" ]:
1092
- arch = re .findall (pattern , self .uri )
1093
- if arch :
1094
- self ._treeArch = arch [0 ]
1095
- break
1096
-
1088
+ self ._treeArch = self ._find_treearch ()
1097
1089
self ._url_prefix = 'current/images'
1098
1090
self ._installer_dirname = self .name .lower () + "-installer"
1099
1091
self ._set_media_paths ()
1100
1092
1093
+ def _find_treearch (self ):
1094
+ for pattern in ["^.*/installer-(\w+)/?$" ,
1095
+ "^.*/daily-images/(\w+)/?$" ]:
1096
+ arch = re .findall (pattern , self .uri )
1097
+ if not arch :
1098
+ continue
1099
+ logging .debug ("Found pattern=%s treearch=%s in uri" ,
1100
+ pattern , arch [0 ])
1101
+ return arch [0 ]
1102
+
1103
+ # Check for standard 'i386' and 'amd64' which will be
1104
+ # in the URI name for --location $ISO mounts
1105
+ for arch in ["i386" , "amd64" ]:
1106
+ if arch in self .uri :
1107
+ logging .debug ("Found treearch=%s in uri" , arch )
1108
+ return arch
1109
+
1110
+ # Otherwise default to amd64
1111
+ arch = "i386"
1112
+ logging .debug ("No treearch found in uri, defaulting to arch=%s" , arch )
1113
+ return arch
1114
+
1101
1115
def _set_media_paths (self ):
1102
1116
self ._boot_iso_paths = ["%s/netboot/mini.iso" % self ._url_prefix ]
1103
1117
0 commit comments