Skip to content

Commit 72693ea

Browse files
committed
server: Fix ApiServer init method, we won't use cfg files and it's not used there
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent dcbb0ec commit 72693ea

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎server/src/com/cloud/api/ApiServer.java‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,22 @@ protected ApiServer() {
166166
super();
167167
}
168168

169-
public static void initApiServer(String[] apiConfig) {
169+
public static void initApiServer() {
170170
if (s_instance == null) {
171171
//Injection will create ApiServer and all its fields which have @Inject
172172
s_instance = ComponentLocator.inject(ApiServer.class);
173-
s_instance.init(apiConfig);
173+
s_instance.init();
174174
}
175175
}
176176

177177
public static ApiServer getInstance() {
178-
// Assumption: CloudStartupServlet would initialize ApiServer
179178
if (s_instance == null) {
180-
s_logger.fatal("ApiServer instance failed to initialize");
179+
ApiServer.initApiServer();
181180
}
182181
return s_instance;
183182
}
184183

185-
public void init(String[] apiConfig) {
184+
public void init() {
186185
BaseCmd.setComponents(new ApiResponseHelper());
187186
BaseListCmd.configure();
188187

‎server/src/com/cloud/servlet/CloudStartupServlet.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void init() throws ServletException {
4848
s_locator = ComponentLocator.getLocator(ManagementServer.Name);
4949
ManagementServer ms = (ManagementServer)ComponentLocator.getComponent(ManagementServer.Name);
5050
ms.enableAdminUser("password");
51-
ApiServer.initApiServer(ms.getPropertiesFiles());
51+
ApiServer.initApiServer();
5252
} catch (InvalidParameterValueException ipve) {
5353
s_logger.error("Exception starting management server ", ipve);
5454
throw new ServletException (ipve.getMessage());

0 commit comments

Comments
 (0)