mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-09 22:37:47 +08:00
str() subdomain names before lookup
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user