Skip to main content
[![Build Status][travisimg]][travis]

# python-otopi-mdp

otopi Machine Dialog Parser for python

This module allows you automate installation process based on
[otopi](https://github.com/oVirt/otopi) installator.

# Requirements

```
otopi
```

# Usage

1. Set otopi environment to enable machine dialect

DIALOG/dialect=str:machine

2. Spawn desired installer and pass stdin and stdout to parser
3. Process all otopi events in the loop


## Example for oVirt Hosted Engine

```python
import subprocess
import otopimdp as mdp

# 1. Set machine dialog option
with open("/etc/ovirt-hosted-engine-setup.env.d/mycustom.env") as fd:
fd.write(
'export environment="${environment} DIALOG/dialect=str:machine"\n'
)

# 2. Spawn installer
installer = subprocess.Popen(["hosted-engine", "--deploy"])
parser = mdp.MachineDialogParser(
input_=installer.stdout, output=installer.stdin
)

# 3. Process events
while True:
event = parser.next_event()
if event is None:
continue
event_type = event[mdp.TYPE_KEY]
if event_type == mdp.TERMINATE_EVENT:
break

event_name = event[mdp.ATTRIBUTES_KEY]['name']
if event_name == "OVEHOSTED_HOST_ID":
event[mdp.REPLY_KEY] = "1"
....
parser.send_response(event)
```

[githubissues]: https://github.com/rhevm-qe-automation/python-otopi-mdp/issues
[travisimg]: https://travis-ci.org/rhevm-qe-automation/python-otopi-mdp.svg?branch=master
[travis]: https://travis-ci.org/rhevm-qe-automation/python-otopi-mdp

Metadata

Release files for python-otopi-mdp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-otopi-mdp 0.1.1
File Size Uploaded
python-otopi-mdp-0.1.1.zip 20.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for python-otopi-mdp 0.1.1
File Interpreter ABI Platform
python_otopi_mdp-0.1.1-py2.7.egg Legacy Egg format - - Details
python-otopi-mdp-0.1.1-1.src.rpm Details

Total release size: 53.6 kB

Release files / python-otopi-mdp-0.1.1.zip

Download URL python-otopi-mdp-0.1.1.zip
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a11d9b518256bcc16de3439bbac79f3f5b0b3c3edfb0812696b78bbaada2611f
BLAKE2b-256 checksum
How to use checksums
0a97e90780f2899198420c3adedfd4200601b5d1dc5052294c12bf591e4c51fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_otopi_mdp-0.1.1-py2.7.egg

Download URL python_otopi_mdp-0.1.1-py2.7.egg
Size 9.9 kB
Tags Egg
SHA-256 checksum
How to use checksums
0b3b5e0d3245a84a9fe0bacf0ea3ce8f8fec15bf26d65bd75de5fb8f7e5ab0c6
BLAKE2b-256 checksum
How to use checksums
fe34826827eb950528dd4b89073e5cefefbca7f211ba7fd043f6cbfbeffcb889
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python-otopi-mdp-0.1.1-1.src.rpm

Download URL python-otopi-mdp-0.1.1-1.src.rpm
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12095846e6be1222646aa4013cb2e29b1419a01910f179eb7a68bc29777b3396
BLAKE2b-256 checksum
How to use checksums
e13958823d49c4f337f7a55ede472e168e2d7a190e5eec9b6fd9a07f4f7447b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2.2

4 release files

0.2.1

3 release files

0.2.0

4 release files

This release

0.1.1 This release

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page