Skip to main content

System information discovery and asset tracking

INSTALLATION

pip install corn

INSTALLATION FOR DEVELOPMENT

Clone the corn repo and install with pip:

git clone https://gitlab.com/saltstack/pop/corn.git
pip install -e corn

EXECUTION

After installation the corn command should now be available.

The command will have no output until it is vertically extended (details below).

TESTING

install requirements-test.txt with pip and run pytest:

pip install -r corn/requirements-test.txt
pytest corn/tests

VERTICAL APP-MERGING

Instructions for extending corn

Install pop:

pip install --upgrade pop

Create a new directory for the project:

mkdir corn_{project_name}
cd corn_{project_name}

Use pop-seed to generate the structure of a project that extends corn:

pop-seed -t v corn_{project_name} -d corn

  • “-t v” specifies that this is a vertically app-merged project

  • “-d corn” says that we want to implement the dynamic name of “corn”

Notice that some structure has been created for you. We especially care about the new directory in corn_{project_name}/corn

Add “corn” to the requirements.txt:

echo "corn" >> requirements.txt

CREATING CORNS

  • Create a new file in “corn_{project_name}/corn”
    • The directory should already have been created by pop-seed.

    • The file name is arbitrary.

    • Every file in this directory, then it’s subdirectories, will be parsed “simultaneously” (as far as that makes sense for asyncio).

    • Corns that are dependant on each other should be assigned in the same function.

    • Do NOT rely on the collector’s recursion strategy for corns to depend on each other.

  • Add your new project to the python path
    • alternatively, run “pip install -e .” from your project’s root directory
      • you only need to do this once

  • Create an async function in this file with a descriptive yet arbitrary name
    • By convention it should start with “load”

    • Make it async unless you have a really really really good reason.

    • Grains that depend on each other already belong in the same function, don’t depend on synchronous programming for determinism

    • Corns can be accessed and assigned like a dictionary, but our convention is to use the namespace

Example:

async def load_my_corn(hub):
    hub.corn.CORN.new_corn = "Hello World!"

And that’s it! Now verify that your corn is collected from the command line:

corn new_corn

Output:

new_corn:
    Hello World!

Metadata

Release files for corn 7

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

Source distribution (sdist)

Source distribution for corn 7
File Size Uploaded Provenance Actions
corn-7.tar.gz 5.7 kB Without provenance Details for corn-7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for corn 7
File Interpreter ABI Platform Actions
corn-7-py3-none-any.whl Python 3 none any Details for corn-7-py3-none-any.whl

Total release size: 11.3 kB

Release files / corn-7.tar.gz

Download URL corn-7.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d0d54cda2fc1496fecc743f0cb534815afd4c694440c7e6b87aca42b2ccbf0a2
BLAKE2b-256 checksum
How to use checksums
2c7632164130b5ba2a6eb78d8dadcbf065f78fe64a8912d64ceb5545c7d15ce6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / corn-7-py3-none-any.whl

Download URL corn-7-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
316879bc798df0eeab7d9b8bfe8b0bcb2d1e78301dbaf42ca6d5af3b140524f5
BLAKE2b-256 checksum
How to use checksums
5f90ac85ff03f4aed46bc0297f3d07b56b290ce8a1772453253e4ce7cb4f3aa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Security for corn 7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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