s.sendall(b'100 - Ok\n')
s.recv(1024) # -> b'100 - Welcome to soma daemon\n'
s.sendall(b'\n') # (empty password)
- if s.recv(1024) == b'100 - Ok\n':
+ if s.recv(1024) != b'100 - Ok\n':
raise SomaException('failed to initialize soma connection')
return s
palinsesto_xml.append(palinsesti_xml)
with soma_connection() as s:
s.sendall(b'106 - Switch to a New Palinsesto Request\n')
- if s.recv(1024) == b'100 - Ok\n':
+ if s.recv(1024) != b'100 - Ok\n':
raise SomaException('failed to switch palinsesto')
s.sendall(ET.tostring(palinsesto_xml).encode('utf-8'))
time.sleep(3)
with soma_connection() as s:
s.sendall(b'122 - Set the current Palinsesto as Default\n')
- if s.recv(1024) == b'100 - Ok\n':
+ if s.recv(1024) != b'100 - Ok\n':
raise SomaException('failed to set current palinsesto as default')