Skip to content

Commit

Permalink
fix: crash quads-web w/out hosts defined, cron/doc
Browse files Browse the repository at this point in the history
* Set _daily_utilization to zero if no hosts defined (new installs)
* Fix QUADS HTML asset templates from not landing

Other small fixes:

* Remove chcon for /var/www/html
* Small clarification on seeing quads-web on first install.
* Add R660/R760 to is_supported
* Expand supported models with R660/R760 for example conf.

fixes: #532

Change-Id: I8d7cf304cf4cbd6423e49ec211f1369ccca51a98
  • Loading branch information
sadsfae committed Sep 27, 2024
1 parent e5fa8c5 commit 7f94aae
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ flask --app quads.server.app init-db
```

- Now you're ready to go and start configuring QUADS environments, hosts, and other components below.
- You should be able to access http://QUADSVM here to see the `quads-web` serving the _Available Hosts_ UI and your QUADS API will also be [available](docs/quads-api.md)
- You should be able to access `quads-web` here now: http://QUADSVM and your [QUADS API](docs/quads-api.md) will also be available.
- Make sure you open up TCP/80 and/or TCP/443 on your host firewall of choice, to enable SSL/TLS follow the next optional section.

#### Using SSL with Flask API and QUADS
Expand Down
2 changes: 1 addition & 1 deletion conf/quads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ default_wipe: True

# If you're using metadata model / search you want to add any system models
# here. Please see docs/quads-host-metadata-search.md
models: R620,R630,R640,R650,R930,R730XD,FC640,DL360,6018R,6048R,1029U-TRTP,1029U-TN10RT,1029P,5039MS,6049P
models: R620,R630,R640,R650,R660,R760,R930,R730XD,FC640,DL360,6018R,6048R,1029U-TRTP,1029U-TN10RT,1029P,5039MS,6049P

# Amount of hours for locking a cloud for redefinition
cloud_reservation_lock: 48
Expand Down
1 change: 0 additions & 1 deletion rpm/quads.spec
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ rm -rf %{buildroot}
/usr/bin/chcon -Rt postgresql_db_t /opt/quads/db/data
/usr/sbin/semanage port -a -t http_port_t -p tcp 5000 2>/dev/null
/usr/sbin/semanage port -a -t http_port_t -p tcp 5001 2>/dev/null
/usr/bin/chcon -R --type=httpd_sys_content_t /var/www/html
/usr/sbin/semanage fcontext -a -t postgresql_db_t "/opt/quads/db/data(/.*)?" 2>/dev/null
/usr/sbin/restorecon -R /opt/quads/db/data
/usr/sbin/setsebool httpd_can_network_connect 1 -P
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ exclude =
quads =
templates/*
web/templates/*
web/templates/wiki/*
web/static/css/*
web/static/js/*

Expand Down
4 changes: 4 additions & 0 deletions src/quads/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ def API_URL(self):
"640",
"r650",
"650",
"660",
"r660",
"760",
"r760",
"r720",
"r730xd",
"r930",
Expand Down
5 changes: 4 additions & 1 deletion src/quads/web/controller/CloudOperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def get_daily_utilization(self) -> int:
"""
_host_count = len(self.__quads_api.filter_hosts({"broken": False, "retired": False}))
_schedules = len(self.__quads_api.get_current_schedules())
_daily_utilization = _schedules * 100 // _host_count
if int(_host_count) == 0:
_daily_utilization = "0"
else:
_daily_utilization = _schedules * 100 // _host_count
return int(_daily_utilization)

def get_cloud_summary_report(self) -> list:
Expand Down

0 comments on commit 7f94aae

Please sign in to comment.