You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2016/11/24 07:15:26 UTC

[3/4] git commit: updated refs/heads/master to c6bb8c6

Merge branch '4.8' into 4.9


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/825935da
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/825935da
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/825935da

Branch: refs/heads/master
Commit: 825935da6902f55023e3df91a9b837eb721fefc2
Parents: 1e88ad4 90ae04b
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Nov 24 12:44:19 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Nov 24 12:44:19 2016 +0530

----------------------------------------------------------------------
 .../debian/config/opt/cloud/bin/cs/CsDhcp.py    |  28 +-
 test/integration/smoke/test_router_dhcphosts.py | 372 ++++++++++++++++++-
 2 files changed, 391 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/825935da/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
----------------------------------------------------------------------
diff --cc systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
index 42ac880,176470d..3ede478
--- a/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
+++ b/systemvm/patches/debian/config/opt/cloud/bin/cs/CsDhcp.py
@@@ -126,15 -127,20 +130,26 @@@ class CsDhcp(CsDataBag)
  
      def add(self, entry):
          self.add_host(entry['ipv4_adress'], entry['host_name'])
- 
 +        # lease time boils down to once a month
 +        # with a splay of 60 hours to prevent storms
 +        lease = randint(700, 760)
-         self.cloud.add("%s,%s,%s,%sh" % (entry['mac_address'],
-                                          entry['ipv4_adress'],
-                                          entry['host_name'],
-                                          lease
-                                          ))
++
+         if entry['default_entry'] == True:
 -            self.cloud.add("%s,%s,%s,infinite" % (entry['mac_address'],
 -                                                  entry['ipv4_adress'],
 -                                                  entry['host_name']))
++            self.cloud.add("%s,%s,%s,%sh" % (entry['mac_address'],
++                                             entry['ipv4_adress'],
++                                             entry['host_name']),
++                                             lease)
+         else:
+             tag = entry['ipv4_adress'].replace(".","_")
 -            self.cloud.add("%s,set:%s,%s,%s,infinite" % (entry['mac_address'],
 -                                                  tag,
 -                                                  entry['ipv4_adress'],
 -                                                  entry['host_name']))
++            self.cloud.add("%s,set:%s,%s,%s,%sh" % (entry['mac_address'],
++                                                    tag,
++                                                    entry['ipv4_adress'],
++                                                    entry['host_name']),
++                                                    lease)
+             self.dhcp_opts.add("%s,%s" % (tag, 3))
+             self.dhcp_opts.add("%s,%s" % (tag, 6))
+             self.dhcp_opts.add("%s,%s" % (tag, 15))
+ 
          i = IPAddress(entry['ipv4_adress'])
          # Calculate the device
          for v in self.devinfo: