Commit d0ae883e by Bach Dániel

firewall, one: random fixes

parent a0658ef3
...@@ -51,3 +51,6 @@ client.crt ...@@ -51,3 +51,6 @@ client.crt
client.key client.key
miscellaneous/store-server/store.config miscellaneous/store-server/store.config
celerybeat-schedule
celerybeat.pid
...@@ -15,6 +15,7 @@ po: ...@@ -15,6 +15,7 @@ po:
for i in */; do cd $$i; ../manage.py makemessages --all -d djangojs || true; cd ..; done for i in */; do cd $$i; ../manage.py makemessages --all -d djangojs || true; cd ..; done
migrate: migrate:
./manage.py syncdb || true
./manage.py migrate ./manage.py migrate
generatestatic: $(jsfiles) one/static/style/style.css generatestatic: $(jsfiles) one/static/style/style.css
......
...@@ -17,7 +17,6 @@ class Firewall: ...@@ -17,7 +17,6 @@ class Firewall:
RULES = None RULES = None
RULES_NAT = [] RULES_NAT = []
vlans = None vlans = None
dmz = None
pub = None pub = None
hosts = None hosts = None
fw = None fw = None
...@@ -269,7 +268,6 @@ class Firewall: ...@@ -269,7 +268,6 @@ class Firewall:
self.IPV6 = IPV6 self.IPV6 = IPV6
self.vlans = models.Vlan.objects.all() self.vlans = models.Vlan.objects.all()
self.hosts = models.Host.objects.all() self.hosts = models.Host.objects.all()
self.dmz = models.Vlan.objects.get(name='DMZ')
self.pub = models.Vlan.objects.get(name='PUB') self.pub = models.Vlan.objects.get(name='PUB')
self.fw = models.Firewall.objects.all() self.fw = models.Firewall.objects.all()
self.ipt_filter() self.ipt_filter()
......
...@@ -101,20 +101,23 @@ class UserCloudDetails(models.Model): ...@@ -101,20 +101,23 @@ class UserCloudDetails(models.Model):
def set_quota(sender, instance, created, **kwargs): def set_quota(sender, instance, created, **kwargs):
if not StoreApi.userexist(instance.user.username): try:
try: if not StoreApi.userexist(instance.user.username):
password = instance.smb_password try:
quota = instance.disk_quota * 1024 password = instance.smb_password
key_list = [key.key for key in instance.user.sshkey_set.all()] quota = instance.disk_quota * 1024
except: key_list = [key.key for key in instance.user.sshkey_set.all()]
pass except:
# Create user pass
if not StoreApi.createuser(instance.user.username, password, # Create user
key_list, quota): if not StoreApi.createuser(instance.user.username, password,
pass key_list, quota):
else: pass
StoreApi.set_quota(instance.user.username, else:
instance.disk_quota * 1024) StoreApi.set_quota(instance.user.username,
instance.disk_quota * 1024)
except:
pass
post_save.connect(set_quota, sender=UserCloudDetails) post_save.connect(set_quota, sender=UserCloudDetails)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment