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

logdir is not respected in Scenario.defaults #20

Closed
goodboy opened this issue Jul 28, 2016 · 0 comments
Closed

logdir is not respected in Scenario.defaults #20

goodboy opened this issue Jul 28, 2016 · 0 comments

Comments

@goodboy
Copy link
Member

goodboy commented Jul 28, 2016

Thanks to @fchareyron for finding this in #19.
It seems we never respect the logdir arg passed into pysipp.walk() or pysipp.scenario() such that it's never set in pysipp.Scenario.defaults. It is however overridden in the underlying agents (by original design) but this is arguably not clear to the user.

In other words:

>>> next(pysipp.walk('./scens/', logdir='/var/tmp'))[1].logdir
'/tmp'

@fchareyron's change to pysipp/__init__.py:96:

- walk(dirpath, autolocalsocks=autolocalsocks, **scenkwargs)
+ walk(dirpath, logdir=logdir, autolocalsocks=autolocalsocks, **scenkwargs)

does resolve this at the Agent level for pysipp.scenario as per:

In [7]: s = pysipp.scenario('./tests/scens/default/', logdir='/var/tmp')

In [8]: s.agents
Out[8]: 
OrderedDict([('uas', <pysipp.agent.UserAgent at 0x7f1b40cc0ed0>),
             ('uac', <pysipp.agent.UserAgent at 0x7f1b40cc0e90>)])

In [9]: s.agents['uac'].logdir
Out[9]: '/var/tmp'

but logdir should really be assigned in Scenario.defaults as well.
We need a test and fix for this.

goodboy pushed a commit that referenced this issue Jul 28, 2016
These changes are hand picked from PR #17.

For #20 this fixes the bug where underlying `Agents` do not have their
`logdir` attribute set properly when passed to `pysipp.scenario`.

Also included is support for more command line flags including:
-oocsf, -users, -deadcall_wait and -trace_error_codes.

Closes #18
@goodboy goodboy added the bug label Jun 10, 2019
goodboy added a commit that referenced this issue Jul 5, 2019
goodboy added a commit that referenced this issue Jul 5, 2019
The `defaults` kwarg to `pysipp.agent.Scenario` isn't used so just drop
it and instead comb through provided `kwargs` and pop out values passed
by the user into `pysipp.agent.Scenario.defaults` making these the "new"
defaults applied to agents. Also, rename the default settings dicts more
explicitly.

Resolves #20
goodboy added a commit that referenced this issue Jul 5, 2019
As per the change for #20, handle the case where the user passes in
a `defaults` kwarg to `pysipp.scenario` and use it override the normal
template. To fully solve #12 also support assignment of `None` which
results in the tuple attribute taking a value of `(None, None)`
implicitly.
goodboy added a commit that referenced this issue Jul 27, 2019
goodboy added a commit that referenced this issue Jul 27, 2019
As per the change for #20, handle the case where the user passes in
a `defaults` kwarg to `pysipp.scenario` and use it override the normal
template. To fully solve #12 also support assignment of `None` which
results in the tuple attribute taking a value of `(None, None)`
implicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant