-
Notifications
You must be signed in to change notification settings - Fork 52
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
not able/failing to stop app #50
Comments
Hi, This is a strange behaviour. Running the following code with my instance of cloudfoundry works app = client.apps.get_first(name='my-application')
print(type(app))
print(app.summary())
app.stop() Is your CF instance recent? Do you have the last version of the cf-python ? |
I'm running the latest version of the client library against PCF 2.4 |
Hi Sorry for the late reply I've been struggling installing PCFDEV Running the following script against a running application works import os
from cloudfoundry_client.client import CloudFoundryClient
def build_client(access_token, refresh_token, target_endpoint):
result = CloudFoundryClient(target_endpoint, verify=False)
result._access_token = access_token
result.refresh_token = refresh_token
return result
if __name__ == '__main__':
local_endpoint = 'http://api.dev.cfdev.sh'
with open(os.path.expanduser('~/.cf/config.json'), 'r') as f:
data = json.load(f)
client = build_client(data['AccessToken'], data['RefreshToken'], local_endpoint)
app = client.apps.get_first(name='my-static-application')
print(type(app))
print(app.summary())
app.stop() We can increase logging to debug by inserting at the beginning of the script if sys.version_info.major == 2:
import httplib as http_client
elif sys.version_info.major == 3:
import http.client as http_client
else:
raise ImportError('Invalid major version: %d' % sys.version_info.major)
http_client.HTTPConnection.debuglevel = 1
logging.basicConfig(level=logging.ERROR,
format='%(levelname)5s - %(name)s - %(message)s')
requests_log = logging.getLogger("requests.packages.urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True The output of script shows
As you can see, the body You can debug further by using wireshark but I fear it may shows the same behaviour. |
successfully instantiating client and retrieving an app with
app = client.v2.apps.get_first(**{'name': <app_name>})
successfully checking app object with
type(app)
app.summary()
but getting this exception when running
app.stop()
would you please help? is there anything I maybe missing?
The text was updated successfully, but these errors were encountered: