str() subdomain names before lookup

This commit is contained in:
Aaron Blankstein
2017-08-22 18:46:40 -04:00
parent 938217f48f
commit 13798e5fa2
3 changed files with 7 additions and 6 deletions

View File

@@ -112,9 +112,9 @@ def update_profiles():
print_status_bar(ix+1, len(names_to_insert))
profile_entry = {}
profile_entry['fqu'] = name
try:
profile_entry['profile'] = get_profile(name, use_legacy = True)['profile']
profile_resp = get_profile(name, use_legacy = True)
profile_entry['profile'] = profile_resp['profile']
updated_profiles[name] = (profile_entry)
actually_updated_names.add(name)
except KeyboardInterrupt as e:

View File

@@ -202,13 +202,13 @@ def get_profile(name, zonefile_storage_drivers=None, profile_storage_drivers=Non
and then loading the profile from that zonefile's public key.
Notes on backwards compatibility (activated if use_legacy=True and use_legacy_zonefile=True):
* (use_legacy=True) If the user's zonefile is really a legacy profile from Onename, then
the profile returned will be the converted legacy profile. The returned zonefile will still
be a legacy profile, however.
The caller can check this and perform the conversion automatically.
* (use_legacy_zonefile=True) If the name points to a current zonefile that does not have a
* (use_legacy_zonefile=True) If the name points to a current zonefile that does not have a
data public key, then the owner address of the name will be used to verify
the profile's authenticity.
@@ -221,7 +221,7 @@ def get_profile(name, zonefile_storage_drivers=None, profile_storage_drivers=Non
proxy = get_default_proxy() if proxy is None else proxy
res = subdomains.is_address_subdomain(name)
res = subdomains.is_address_subdomain(str(name))
if res:
subdomain, domain = res[1]
try:

View File

@@ -376,7 +376,8 @@ def parse_zonefile_subdomains(domain, zonefile_json):
def is_address_subdomain(fqa):
"""
Tests whether fqa is a subdomain.
Tests whether fqa is a subdomain.
@fqa must be a string
If it isn't, returns False.
If it is, returns True and a tuple (subdomain_name, domain)
"""