Giter Site home page Giter Site logo

salt-extensions / saltext-pushover Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 4.81 MB

Salt Extension for interacting with Pushover

Home Page: https://salt-extensions.github.io/saltext-pushover/

License: Apache License 2.0

Python 99.39% Jinja 0.61%
salt salt-extension saltstack

saltext-pushover's Issues

[BUG] `device`, `retry`, `priority` and `expire` are required, but should not be

Description
When device, retry, priority or expire is not specified, the API returns an error since this extension tries to send None values. I'm not sure when the behavior changed or if this ever worked as expected, but I have carried a custom patch for some time now.

I'll quickly fix some basic issues like this, but really think this extension needs a proper rewrite in a v2.

Steps to Reproduce the behavior
Try to send a message without specifying one of the values.

Expected behavior
Works.

Screenshots
Crash.

[TECH DEBT] Required values should be required

Description of the tech debt to be addressed, include links and screenshots

Functions in this extension declare default values for all parameters, even if they are required. This results in a suboptimal interface and code layout (which needs to check for non-falsy required values).

Example:

message is a required parameter for pushover.post_message. It's the third positional argument though, after user and device, both of which are read from the configuration if unspecified. Thus one cannot simply call salt["pushover.notify"]("My message").

[BUG] Superfluous parameters

Description
Several functions in this extension take an api_version parameter, which is completely ignored.
The (superfluous) state module exposes a sound parameter, which is ignored.
The query utils func exposes token, which is ignored.

Steps to Reproduce the behavior
Set api_version to anything and see the extension still working.

Expected behavior
Don't expose parameters which do nothing.

There is only a single API version. We don't know how a successor will be structured, so we cannot assume the module code to just work. Only the query util func should retain the parameter for custom modules.

[BUG] `sound` and `user` are validated during each request

Description
See title. This causes 2 (3 if sound is specified) API calls for each notification.

Steps to Reproduce the behavior
Use the extension.

Expected behavior
If the validation works, cache it and only revalidate infrequently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.