We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Actual example:
<14>{{next(date_generator)}} {{ fake.random_element(('ABCDEFGHI01', 'ABCDEFGHI02')) }} firewall.cisco.asa: 2018-03-22T23:56:09.237067-07:00 : %ASA-123456: Teardown dynamic {{ fake.random_element(('TCP', 'UDP', 'ICMP')) }} translation from inside:{{ fake.ipv4() }}/{{ fake.int(1, 65000) }} to outside:{{ fake.ipv4() }}/{{ fake.int(1, 65000) }} duration 0:02:32
Its wrong, the new use of random_element must import OrderedDict from collections, one example can be:
`from devoutils.faker import SyslogFakeGenerator from collections import OrderedDict
def get_choices(): return ["Failed", "Success", "Totally broken", "404", "500", "What?"]
if name == "main": with open("orderer_dict.jinja2", 'r') as myfile: template1 = myfile.read()
custom = {"od": OrderedDict} f = SyslogFakeGenerator(engine=1, template=template1, simulation=True, probability=100, frequency=(1, 1), providers=custom, verbose=True) f.start()
`
{%- set re = fake.random_element(elements=od([("a", 0.7), ("b", 0.2), ("c", 0.05), ("d", 0.05)])) -%} nabo {{ re }}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Actual example:
<14>{{next(date_generator)}} {{ fake.random_element(('ABCDEFGHI01', 'ABCDEFGHI02')) }} firewall.cisco.asa: 2018-03-22T23:56:09.237067-07:00 : %ASA-123456: Teardown dynamic {{ fake.random_element(('TCP', 'UDP', 'ICMP')) }} translation from inside:{{ fake.ipv4() }}/{{ fake.int(1, 65000) }} to outside:{{ fake.ipv4() }}/{{ fake.int(1, 65000) }} duration 0:02:32
Its wrong, the new use of random_element must import OrderedDict from collections, one example can be:
`from devoutils.faker import SyslogFakeGenerator
from collections import OrderedDict
def get_choices():
return ["Failed", "Success", "Totally broken", "404", "500", "What?"]
if name == "main":
with open("orderer_dict.jinja2", 'r') as myfile:
template1 = myfile.read()
`
{%- set re = fake.random_element(elements=od([("a", 0.7), ("b", 0.2), ("c", 0.05), ("d", 0.05)])) -%} nabo {{ re }}
The text was updated successfully, but these errors were encountered: