Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: UDMI Python Library #1084

Closed
wants to merge 17 commits into from

Conversation

khyatimahendru
Copy link
Collaborator

No description provided.

@khyatimahendru khyatimahendru requested a review from grafnu February 6, 2025 09:32
import scapy.layers.inet
import scapy.sendrecv

from udmi_schema.schema.events_discovery import DiscoveryEvents
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to simplify this a bit, to make it less redundant? E.g., ideally it would be something like

from udmi.schema import DiscoveryEvents
or
import udmi.schema.discovery_events

time.sleep(RUNNER_LOOP_INTERVAL)

@catch_exceptions_to_status
def apply_discovery_config(self, config_dict):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a place in here where there's an example of how this dict is created? I can guess (likely just a standard json-to-dict parsing), but I wanted to get it codified somewhere to be 100% sure. I saw the self.publish(event.to_json()) code elsewhere, so I'm looking for the inverse...

(also, as an abstraction thing I'd expect the input/output paths to be roughly similar, so that the concept of "json" is either entirely in this layer, or not... so if JSON is output here then it would also be parsed here. I.e. it produces the same kind of thing that it consumes!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants