splunk/splunk-sdk-python — Issue #13: Enhancement: Context#prefix should be a property
Author: Ansman
Created: 2011-11-03 19:44:21+00:00
State: open

Currently the `prefix` is an attribute in `Context` but this causes some problems.

In our framework you can change the ports Splunk listens to which causes our framework to update the ports of the `Service`

However, writing to `port` does not update the `prefix` variable so it won't be reflected when making requests.

I suggest the following code:

class Context:
....
@property
def prefix(self):
return "%s://%s:%s" % (self.scheme, self.host, self.port)