Another possibility would be to clean up the error in such a way that you get the actual command that was being run. In this case I was running "state-get" so having it say
state-get not implemented in a restricted context
would be my ideal message.
Note that other than knowing we are running collect-metrics, we don't seem to have a way to know that we are running in a restricted context. So if Juju changes to no longer run collect-metrics asynchronously, we'll want a way to know that it is safe to operate as normal.
Another possibility would be to clean up the error in such a way that you get the actual command that was being run. In this case I was running "state-get" so having it say
state-get not implemented in a restricted context
would be my ideal message.
Note that other than knowing we are running collect-metrics, we don't seem to have a way to know that we are running in a restricted context. So if Juju changes to no longer run collect-metrics asynchronously, we'll want a way to know that it is safe to operate as normal.