Skip to content

Commit

Permalink
addressing #25
Browse files Browse the repository at this point in the history
  • Loading branch information
iannesbitt committed Jun 1, 2023
1 parent 9e2af4c commit f5da688
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mnonboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,9 @@ def create_names_xml(loc, node_id, names):
xd['ns2:person']['subject'] = id
xd['ns2:person']['givenName'] = first
xd['ns2:person']['familyName'] = last
xm = xmltodict.unparse(xd)
fn = os.path.join(loc, '%s_%s%s.xml' % (node_id, first[0], last))
xmltodict.unparse(xd, output=fn)
L.debug('XML path: %s' % fn)
L.debug('XML content:\n%s' % (xm))
save_xml(fn, xm)
files.append(fn)
return files

Expand Down Expand Up @@ -360,7 +358,7 @@ def create_subj_in_acct_svc(ssh: SSHClient, cert: str, files: list, cn: str):
"""
for f in files:
f = os.path.split(f)[1]
command = 'curl -s --cert %s -F person=@%s -X POST https://%s/cn/v2/accounts' % (
command = 'curl -s --cert %s -F person=@%s -X POST %s/v2/accounts' % (
cert, f, cn
)
L.info('Creating subject: %s' % (command))
Expand All @@ -371,7 +369,7 @@ def validate_subj_in_acct_svc(ssh: SSHClient, cert: str, names: dict, cn: str):
"""
for n in names:
orcid_urlenc = urlparse.quote(n)
command = 'curl -s --cert %s -X PUT https://%s/cn/v2/accounts/verification/%s' % (
command = 'curl -s --cert %s -X PUT %s/v2/accounts/verification/%s' % (
cert, cn, orcid_urlenc
)
L.info('Validating subject: %s' % (command))
Expand Down

0 comments on commit f5da688

Please sign in to comment.