@@ -79,6 +79,13 @@ def info(self):
7979 ee_db_pass = ''
8080 if os .path .isfile ('/etc/nginx/sites-available/{0}'
8181 .format (ee_domain )):
82+ check_site = getSiteInfo (self , ee_domain )
83+ if check_site is None :
84+ Log .error (self , " Site {0} does not exist." .format (ee_domain ))
85+ else :
86+ sitetype = check_site .site_type
87+ cachetype = check_site .cache_type
88+
8289 ee_site_webroot = EEVariables .ee_webroot + ee_domain
8390 access_log = (ee_site_webroot + '/logs/access.log' )
8491 error_log = (ee_site_webroot + '/logs/error.log' )
@@ -98,7 +105,10 @@ def info(self):
98105 data = dict (domain = ee_domain , webroot = ee_site_webroot ,
99106 accesslog = access_log , errorlog = error_log ,
100107 dbname = ee_db_name , dbuser = ee_db_user ,
101- dbpass = ee_db_pass )
108+ dbpass = ee_db_pass , type = sitetype + " " + cachetype +
109+ " ({0})" .format ("enabled"
110+ if check_site .is_enabled else
111+ "disabled" ))
102112 self .app .render ((data ), 'siteinfo.mustache' )
103113 else :
104114 Log .error (self , " site {0} does not exists" .format (ee_domain ))
@@ -578,9 +588,9 @@ def default(self):
578588 or self .app .pargs .wpfc or self .app .pargs .wpsc )):
579589
580590 if ((oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ])
581- or (oldsitetype is 'wp' and oldcachetype is 'basic' )):
582- print ( oldsitetype , oldcachetype )
583- Log .error (self , " Cannot update {0}, {1} {2} to wp basic"
591+ or (oldsitetype == 'wp' and oldcachetype == 'basic' )):
592+
593+ Log .error (self , "Cannot update {0} {1} {2} to wp basic"
584594 .format (ee_domain , oldsitetype , oldcachetype ))
585595
586596 data = dict (site_name = ee_domain , www_domain = ee_www_domain ,
@@ -597,8 +607,8 @@ def default(self):
597607 (self .app .pargs .wpfc or self .app .pargs .wpsc )):
598608
599609 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ]
600- or (oldsitetype is 'wp' and oldcachetype is 'w3tc' )):
601- Log .error (self , " Cannot update {0}, {1} {2} to wp w3tc"
610+ or (oldsitetype == 'wp' and oldcachetype == 'w3tc' )):
611+ Log .error (self , "Cannot update {0}, {1} {2} to wp w3tc"
602612 .format (ee_domain , oldsitetype , oldcachetype ))
603613
604614 data = dict (site_name = ee_domain , www_domain = ee_www_domain ,
@@ -616,7 +626,7 @@ def default(self):
616626 (self .app .pargs .wpsc or self .app .pargs .w3tc )):
617627
618628 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ]
619- or (oldsitetype is 'wp' and oldcachetype is 'wpfc' )):
629+ or (oldsitetype == 'wp' and oldcachetype == 'wpfc' )):
620630 Log .error (self , "Cannot update {0}, {1} {2} to wp wpfc"
621631 .format (ee_domain , oldsitetype , oldcachetype ))
622632
@@ -634,7 +644,7 @@ def default(self):
634644 (self .app .pargs .w3tc or self .app .pargs .wpfc )):
635645
636646 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ]
637- or (oldsitetype is 'wp' and oldcachetype is 'wpsc' )):
647+ or (oldsitetype == 'wp' and oldcachetype == 'wpsc' )):
638648 Log .error (self , "Cannot update {0}, {1} {2} to wp wpsc"
639649 .format (ee_domain , oldsitetype , oldcachetype ))
640650
@@ -657,7 +667,7 @@ def default(self):
657667
658668 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
659669 'wpsubdir' ]
660- or (oldsitetype is 'wpsubdir' and oldcachetype is 'basic' )):
670+ or (oldsitetype == 'wpsubdir' and oldcachetype == 'basic' )):
661671 Log .error (self , " Cannot update {0}, {1} {2} "
662672 "to wpsubdir basic"
663673 .format (ee_domain , oldsitetype , oldcachetype ))
@@ -677,7 +687,7 @@ def default(self):
677687
678688 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
679689 'wpsubdir' ]
680- or (oldsitetype is 'wpsubdir' and oldcachetype is 'w3tc' )):
690+ or (oldsitetype == 'wpsubdir' and oldcachetype == 'w3tc' )):
681691 Log .error (self , " Cannot update {0} {1} {2}"
682692 "to wpsubdir w3tc"
683693 .format (ee_domain , oldsitetype , oldcachetype ))
@@ -698,8 +708,8 @@ def default(self):
698708
699709 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
700710 'wpsubdir' ]
701- or (oldsitetype is 'wpsubdir' and oldcachetype is 'wpfc' )):
702- Log .error (self , " Cannot update {0} {1} {2}"
711+ or (oldsitetype == 'wpsubdir' and oldcachetype == 'wpfc' )):
712+ Log .error (self , "Cannot update {0} {1} {2}"
703713 " to wpsubdir wpfc"
704714 .format (ee_domain , oldsitetype , oldcachetype ))
705715
@@ -718,7 +728,7 @@ def default(self):
718728
719729 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
720730 'wpsubdir' ]
721- or (oldsitetype is 'wpsubdir' and oldcachetype is 'wpsc' )):
731+ or (oldsitetype == 'wpsubdir' and oldcachetype == 'wpsc' )):
722732 Log .error (self , " Cannot update {0} {1} {2}"
723733 " to wpsubdir wpsc"
724734 .format (ee_domain , oldsitetype , oldcachetype ))
@@ -736,13 +746,16 @@ def default(self):
736746 if (self .app .pargs .wpsubdomain and not (self .app .pargs .html or
737747 self .app .pargs .php or self .app .pargs .mysql or
738748 self .app .pargs .wpsubdir or self .app .pargs .wp )):
749+ if (self .app .pargs .wpsubdomain and not (self .app .pargs .w3tc
750+ or self .app .pargs .wpfc or self .app .pargs .wpsc )):
751+ if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
752+ 'wpsubdomain' ]
753+ or (oldsitetype == 'wpsubdomain' and
754+ oldcachetype == 'basic' )):
739755
740- if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
741- 'wpsubdomain' ]
742- or (oldsitetype is 'wpsubdomain' and oldcachetype is 'basic' )):
743- Log .error (self , " Cannot update {0} {1} {2}"
744- " to wpsubdomain basic"
745- .format (ee_domain , oldsitetype , oldcachetype ))
756+ Log .error (self , " Cannot update {0} {1} {2}"
757+ " to wpsubdomain basic"
758+ .format (ee_domain , oldsitetype , oldcachetype ))
746759
747760 data = dict (site_name = ee_domain , www_domain = ee_www_domain ,
748761 static = False , basic = True , wp = True , w3tc = False ,
@@ -760,7 +773,8 @@ def default(self):
760773
761774 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
762775 'wpsubdomain' ] or
763- (oldsitetype is 'wpsubdomain' and oldcachetype is 'w3tc' )):
776+ (oldsitetype == 'wpsubdomain' and oldcachetype == 'w3tc' )):
777+ print (oldsitetype , oldcachetype )
764778 Log .error (self , " Cannot update {0}, {1} {2}"
765779 " to wpsubdomain w3tc"
766780 .format (ee_domain , oldsitetype , oldcachetype ))
@@ -781,7 +795,8 @@ def default(self):
781795
782796 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
783797 'wpsubdomain' ] or
784- (oldsitetype is 'wpsubdomain' and oldcachetype is 'wpfc' )):
798+ (oldsitetype == 'wpsubdomain' and oldcachetype == 'wpfc' )):
799+ print (oldsitetype , oldcachetype )
785800 Log .error (self , " Cannot update {0}, {1} {2} "
786801 "to wpsubdomain wpfc"
787802 .format (ee_domain , oldsitetype , oldcachetype ))
@@ -802,7 +817,8 @@ def default(self):
802817
803818 if (oldsitetype not in ['html' , 'php' , 'mysql' , 'wp' ,
804819 'wpsubdomain' ] or
805- (oldsitetype is 'wpsubdomain' and oldcachetype is 'wpsc' )):
820+ (oldsitetype == 'wpsubdomain' and oldcachetype == 'wpsc' )):
821+ print (oldsitetype , oldcachetype )
806822 Log .error (self , " Cannot update {0}, {1} {2}"
807823 " to wpsubdomain wpsc"
808824 .format (ee_domain , oldsitetype , oldcachetype ))
0 commit comments