MCPcopy Create free account
hub / github.com/apache/solr / runAndSendGPGPassword

Function runAndSendGPGPassword

dev-tools/scripts/buildAndPushRelease.py:48–71  ·  view source on GitHub ↗
(command, password)

Source from the content-addressed store, hash-verified

46
47
48def runAndSendGPGPassword(command, password):
49 p = subprocess.Popen(command, shell=True, bufsize=0, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE)
50 f = open(LOG, 'ab')
51 while True:
52 p.stdout.flush()
53 line = p.stdout.readline()
54 if len(line) == 0:
55 break
56 f.write(line)
57 if line.find(b'Enter GPG keystore password:') != -1:
58 time.sleep(1.0)
59 p.stdin.write((password + '\n').encode('UTF-8'))
60 p.stdin.write('\n'.encode('UTF-8'))
61
62 try:
63 result = p.wait(timeout=120)
64 if result != 0:
65 msg = ' FAILED: %s [see log %s]' % (command, LOG)
66 print(msg)
67 raise RuntimeError(msg)
68 except TimeoutExpired:
69 msg = ' FAILED: %s [timed out after 2 minutes; see log %s]' % (command, LOG)
70 print(msg)
71 raise RuntimeError(msg)
72
73def load(urlString, encoding="utf-8"):
74 try:

Callers 1

prepareFunction · 0.85

Calls 6

encodeMethod · 0.80
waitMethod · 0.80
writeMethod · 0.65
flushMethod · 0.45
findMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…