allow hivename hxxx and vmxxxx in JsonPillar
This commit is contained in:
parent
139ac93193
commit
40f4429922
@ -51,8 +51,16 @@ public class JsonPillarServlet extends HttpServlet {
|
||||
if (hiveFqdn != null && hiveFqdn.length() == 19 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("h")) {
|
||||
hiveName = hiveFqdn.substring(0, 3);
|
||||
} else {
|
||||
em.close();
|
||||
throw new ServletException("error in hive parameter");
|
||||
if (hiveFqdn != null && hiveFqdn.length() == 20 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("h")) {
|
||||
hiveName = hiveFqdn.substring(0, 4);
|
||||
} else {
|
||||
if (hiveFqdn != null && hiveFqdn.length() == 22 && hiveFqdn.endsWith(".hostsharing.net") && hiveFqdn.startsWith("vm")) {
|
||||
hiveName = hiveFqdn.substring(0, 6);
|
||||
} else {
|
||||
em.close();
|
||||
throw new ServletException("error in hive parameter");
|
||||
}
|
||||
}
|
||||
}
|
||||
final Query hiveQuery = em.createQuery("SELECT h FROM Hives h WHERE h.name = :hive");
|
||||
hiveQuery.setParameter("hive", hiveName);
|
||||
|
Loading…
Reference in New Issue
Block a user