@@ -100,7 +100,8 @@ def get_config_value(logger, name, uri):
100
100
urllib .parse .quote_plus (name )))
101
101
102
102
if not r :
103
- logger .error ('could not get config value ' + name )
103
+ logger .error ("Cannot get the '{}' config value from the web "
104
+ "application on {}" .format (name , uri ))
104
105
return None
105
106
106
107
return r .text
@@ -117,7 +118,8 @@ def get_repo_type(logger, repository, uri):
117
118
r = get (logger , get_uri (uri , 'api' , 'v1' , 'repositories' , 'type' ),
118
119
params = payload )
119
120
if not r :
120
- logger .error ('could not get repo type for ' + repository )
121
+ logger .error ('could not get repository type for {} from web'
122
+ 'application on {}' .format (repository , uri ))
121
123
return None
122
124
123
125
line = r .text
@@ -129,7 +131,8 @@ def get_repo_type(logger, repository, uri):
129
131
def get_configuration (logger , uri ):
130
132
r = get (logger , get_uri (uri , 'api' , 'v1' , 'configuration' ))
131
133
if not r :
132
- logger .error ('could not get configuration' )
134
+ logger .error ('could not get configuration from web application on {}' .
135
+ format (uri ))
133
136
return None
134
137
135
138
return r .text
@@ -140,7 +143,8 @@ def set_configuration(logger, configuration, uri):
140
143
data = configuration )
141
144
142
145
if not r :
143
- logger .error ('could not set configuration' )
146
+ logger .error ('could not set configuration for web application on {}' .
147
+ format (uri ))
144
148
return False
145
149
146
150
return True
@@ -149,7 +153,8 @@ def set_configuration(logger, configuration, uri):
149
153
def list_indexed_projects (logger , uri ):
150
154
r = get (logger , get_uri (uri , 'api' , 'v1' , 'projects' , 'indexed' ))
151
155
if not r :
152
- logger .error ('could not list indexed projects' )
156
+ logger .error ('could not list indexed projects from web application '
157
+ 'on {}' .format (uri ))
153
158
return None
154
159
155
160
return r .json ()
@@ -159,7 +164,8 @@ def add_project(logger, project, uri):
159
164
r = post (logger , get_uri (uri , 'api' , 'v1' , 'projects' ), data = project )
160
165
161
166
if not r :
162
- logger .error ('could not add project ' + project )
167
+ logger .error ('could not add project {} for web application on {}' .
168
+ format (project , uri ))
163
169
return False
164
170
165
171
return True
@@ -170,7 +176,8 @@ def delete_project(logger, project, uri):
170
176
urllib .parse .quote_plus (project )))
171
177
172
178
if not r :
173
- logger .error ('could not delete project ' + project )
179
+ logger .error ('could not delete project in web application on {}' .
180
+ format (project , uri ))
174
181
return False
175
182
176
183
return True
0 commit comments